Putting all js and css to one file?

Some one have a working example?

I tried to do it with the scriptMap, but it’s do nothing…

I except from it to create all.js, and put there all the js I insert…

Or I don’t understand the way it should work?

http://www.yiiframework.com/doc/guide/1.1/en/topics.performance


$cs=Yii::app()->clientScript;

$cs->scriptMap=array(

    'myscript1.js'=>'/js/all.js',

    'myscript2.js'=>'/js/all.js',

    'myscript3.js'=>'/js/all.js',

    ....



what next?

up… need your help thx!

I think you may have missed the following from the section of the guide you referred to:

/Tommy

there are already two extensions that have functionality to combine, minify, and compress js and css files

http://www.yiiframew…sion/minscript/ after installation you can choose minifier. open /extensions/minScript/vendors/minify/min/config.php for more details

http://www.yiiframew…t-clientscript/ using Closure compiler for js, and YUIcompressor for css. Needs a working JRE on server. will need small fix, see comment