<?phpclass Indexcontroller extends phalcon\mvc\controller{public function Index () { //Add local CSS Resource $this->assets ->addcss (' css/style.css ') ->addcss (' css/index.css '); Add local JS resource $this->assets ->addjs (' js/jquery.js ') ->addjs (' js/bootstrap.min.js ');} }
Phtml
Method Two: Remote file
<?phppublic function Indexaction () { //Add remote and local resources $this->assets ->addcss ('/// Netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css ', True) ->addCss (' css/ Style.css ', false);}
Phtml
Ditto
Method Three:
<?php//html Head of JS Resources $this->assets ->collection (' header ') ->addjs (' js/jquery.js ') Addjs (' js/bootstrap.min.js ');//html tail js resource $this->assets ->collection (' footer ') ->addjs (' js/ Jquery.js ') ->addjs (' js/bootstrap.min.js ');
Phtml
Phalcon: Resource file Management introduces CSS,JS