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.

Jsmin and Cssmin not generate minified file !

Someone managed to use the filters minification of javascript and stylesheets (\Phalcon\Assets\Filters\Jsmin and \Phalcon\Assets\Filters\Cssmin)?

I tried numerous times, recompile the Phalcon, according to the tips on this topic this: http://forum.phalconphp.com/discussion/3637/phalcon-assets-filters-jsmin-non-free-jsminifier-not-available

$this->assets->collection('javascripts')
->addJs('style.js')
->setTargetPath('production.js')
->setTargetUri('production.js')
->addFilter(new Phalcon\Assets\Filters\Jsmin());

I can not generate the final file with all the minified content, neither filters seems to work!

Use the Phalcon 1.3.4! Anyone have any tips?

Thanks !



18.5k

I see in the docs that you forgotted to add ->join(true) before the filters (maybe?) ( http://docs.phalconphp.com/en/latest/reference/assets.html#minification-filtering ).



847
edited Jan '15

Indeed, unfortunately ->join (true) does not work even so! also does not throw any exception !



18.5k

Maybe adding the files after setting the paths...



847
Accepted
answer
edited Jan '15

RompePC, I really appreciate your help, but the error was totally mine, to generate my final file, i forgot to define which collection should be set! For example:

$this->assets->outputJs (); // Not generate final file
$this->assets->outputJs ('my_collection_name'); // Generate correctly

Thanks !



18.5k

xD

Mark your answer as an accepted answer then.