| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente |
| en:slam4:php:phalcon:jquery [2015/02/06 19:25] – jcheron | en:slam4:php:phalcon:jquery [2019/08/31 14:21] (Version actuelle) – modification externe 127.0.0.1 |
|---|
| ====== Phalcon-JQuery ====== | ====== Phalcon-JQuery ====== |
| |
| {{:slam4:php:phalcon:jquery:phalcon-jquery.png?|Phalcon-JQuery logo}} | <html><div class="noborder"></html> |
| | |< 100% >| |
| Phalcon-JQuery is a PHP library compatible with the Framework Phalcon. It allows to easily integrate jQuery, jQuery UI or [[http://getbootstrap.com/|Bootstrap]] in Phalcon Web projects, respecting the separation of MVC layers. | |{{:slam4:php:phalcon:jquery:phalcon-jquery.png?|Phalcon-JQuery logo}} | Phalcon-JQuery is a PHP library compatible with the Framework Phalcon. It allows to easily integrate jQuery, jQuery UI or [[http://getbootstrap.com/|Bootstrap]] in Phalcon Web projects, respecting the separation of MVC layers. | |
| | <html></div></html> |
| ===== -- Installation ===== | ===== -- Installation ===== |
| - Download Phalcon-JQuery at [[https://github.com/jcheron/phalcon-jquery/archive/master.zip|gitHub]] | - Download Phalcon-JQuery on [[https://github.com/jcheron/phalcon-jquery/archive/master.zip|gitHub]] |
| - Unzipthe archive in a loacal folder and copy the Ajax folder and his content in the folder libraries defined in your Phalcon configuration file : | - Unzip the archive in a local folder and copy the Ajax folder and his content in the folder libraries defined in your Phalcon configuration file : |
| |
| {{:slam4:php:phalcon:jquery:lib-in-phalcon-project.png?nolink|Inégration de la librairie Phalcon-JQuery dans un projet}} | <html><div class="noborder"></html> |
| | |< 100% >| |
| | |{{:slam4:php:phalcon:jquery:lib-in-phalcon-project.png?nolink|Intégration de la librairie Phalcon-JQuery dans un projet}} | <sxh php;title:app/config/config.php;highlight:[6]> |
| | 'application' => array( |
| | 'controllersDir' => __DIR__ . '/../../app/controllers/', |
| | 'modelsDir' => __DIR__ . '/../../app/models/', |
| | 'viewsDir' => __DIR__ . '/../../app/views/', |
| | 'pluginsDir' => __DIR__ . '/../../app/plugins/', |
| | 'libraryDir' => __DIR__ . '/../../app/library/', |
| | 'cacheDir' => __DIR__ . '/../../app/cache/', |
| | 'baseUri' => '/atp/', |
| | ) |
| | </config> |
| | </sxh> | |
| | <html></div></html> |
| |
| ===== -- Configuration ===== | ===== -- Configuration ===== |
| | ==== -- Service injection ==== |
| | For adding Phalcon-JQuery to a Phalcon project, it is necessary to inject the JQuery service at application startup : |
| |
| | <sxh php;title:services.php> |
| | $di->set("jquery",function(){ |
| | $jquery= new JsUtils(array("driver"=>"Jquery")); |
| | $jquery->ui(new JqueryUI());//optional for JQuery UI |
| | $jquery->bootstrap(new Bootstrap());//Optional for Twitter Bootstrap |
| | return $jquery; |
| | }); |
| | </sxh> |
| | ==== -- JS libraries integration ==== |
| |
| ===== -- Usage ===== | ===== -- Usage ===== |