prestui
1.0.0
Prestui是一個UI庫,可幫助您開發Prestashop模塊的接口。它允許您編寫一個簡潔的HTML,與所有最新版本的Prestashop(1.5、1.6和1.7)兼容。 Prestui將自動調整該模塊的Prestashop版本。
例如,您可以寫:
< ps-switch name =" switch " label =" Switch " yes =" Yes " no =" No " active =" true " > </ ps-switch >您將自動獲得類似的東西,這是Prestashop的有效HTML(在這裡1.6+):
< div class =" form-group " >
< label class =" control-label col-lg-3 " > < span > Switch </ span > </ label >
< div class =" col-lg-9 " >
< span class =" switch prestashop-switch fixed-width-lg " >
< input type =" radio " value =" 1 " name =" switch " id =" switch_on " checked =" checked " >
< label for =" switch_on " > Yes </ label >
< input type =" radio " value =" 0 " name =" switch " id =" switch_off " >
< label for =" switch_off " > No </ label >
< a class =" slide-button btn " > </ a >
</ span >
</ div >
</ div >Prestui基於Riotjs 3,這是一個非常輕的反應式用戶界面庫。您可以在GitHub上找到有關Riotjs的更多信息,並在官方網站上找到完整的文檔。
要使用Prestui,您需要將文件包括在模塊中。下載prestui並在/views/templates/admin/中移動文件夾
您還需要包含Riotjs+編譯器,因為所有組件均基於它。您可以下載副本並將其包含在模塊中,也可以使用CDN。
您現在可以包括Prestui和Riotjs:
$ this -> context -> controller -> addJS ( ' path/to/riot+compiler.js ' )
$ html = $ this -> display ( __FILE__ , ' path/to/your/file.tpl ' )
return $ html. $ this -> display ( __FILE__ , ' views/templates/admin/prestui/ps-tags.tpl ' );如果您只需要幾個標籤,則可以在渲染PS-TAG之前只使用所需的組分配一個變量:
$ this -> smarty -> assign ( ' tags ' , array ( ' tabs ' , ' panel ' ));所有可用標籤及其屬性均在Wiki上列出
找到一個錯誤還是有想法?使用GitHub的門票系統。如果您想幫助並添加功能或修復錯誤,則需要提出拉動請求:
Prestui已獲得MIT許可證的許可