We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Volt stylesheetLink with GET parameter

Can I use stylesheetLink with GET parameter for versioning? Example, I need

<link rel="stylesheet" type="text/css" href="/css/app.min.css?v=1.0.1" />



85.5k
edited Jan '17
    https://docs.phalcon.io/en/3.0.2/reference/assets.html

than


$this->di->setShared("assets") use ($config) {

//....
>addcss("css/style.css?" . $cofnig->version);
...


13.8k
edited Jan '17

this method I think not correct. In case when I need use dynamic versions this method is not work in VOLT example I buld new version of css or js files and I want sent to stylesheetLink function this version dynamically. Not

{{ stylesheetLink("css/app.min.css?v=1.0.2") }}

But

{{ stylesheetLink("css/app.min.css", false, $version) }}



43.9k
edited Jan '17

Hi,

that should be exactly what you want: https://github.com/phalcon/phalcon-devtools/blob/master/scripts/Phalcon/Mvc/Controller/Base.php

use setTargetUri() in assets definitions and {{ assets.outputCss("main_css") }} in views