Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

How to insert Css, Javascript to <head> tag html in Phalcon

Hi Phalcon, I've worked with Yii framework. In Yii, I can call at any place and it is always placed at the beginning of the <title> tag: Yii :: app () -> clientScript-> registerCssFile ( 'product.css');

Is result: <head> <link href="product.css" rel="stylesheet"> <title></title> </head>

In phalcon can do this? Pelase help me

Yes sir, thank Oleg for support. How to use this in view file

// Add some local CSS resources $this->assets ->addCss('css/style.css') ->addCss('css/index.css');

    // And some local JavaScript resources
    $this->assets
        ->addJs('js/jquery.js')
        ->addJs('js/bootstrap.min.js');


44.3k

Why use this in views while we have use in controller, if you want to this just{{this.assets.addJs())}}

Use it in controller/some config file, and then in volt:

{{assets.outputJs/Css()}} will output all css/js files