We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

How to setup a minify CSS or JS in Phalcon?

I'm following this tutorial: https://docs.phalcon.io/en/latest/reference/assets.html

And this is my implement code:

    ->addCss($config->static->url . '/css/font-awesome.min.css', false)
    ->addCss($config->static->url . '/css/bcdcnt.css', false)
    ->addFilter(new Phalcon\Assets\Filters\Cssmin());

In my view:

{{ assets.outputCss('header') }}

And the result:

<link rel="stylesheet" type="text/css" href="/index/final.css">

But when clicking in the generated link "/index.final.css", it says that:

Action 'final.css' was not found on handler 'index'

So my question is that how to set up a minify CSS or JS using asset built in featued of Phalcon?

edited Aug '14

everything looks good in your code except:


you have to correct that