Ceci est une ancienne révision du document !
Phalcon-JQuery
| Phalcon-JQuery is a PHP library compatible with the Framework Phalcon. It allows to easily integrate jQuery, jQuery UI or Bootstrap in Phalcon Web projects, respecting the separation of MVC layers. |
-- Installation
- Download Phalcon-JQuery on gitHub
- 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 :
|
'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>
|
-- Configuration
-- Injection du service
For adding Phalcon-JQuery to a Phalcon project, it is necessary to inject the JQuery service at application startup :
$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;
});
