All parameters can be set in your main.php config. No need for altering your code, just set and forget.
Needs Yii 1.0.4/1.1.x or greater, and for compression JSMin and CSSTidy.
- Yii 1.0.4/1.1.x or above
Since version 0.9
- Extract the zip file under 'proctected/extensions'
- Add the following to your 'config/main.php':
// application components 'components'=>array( .... 'clientScript'=>array( 'class'=>'ext.ExtendedClientScript.ExtendedClientScript', 'combineCss'=>true, 'compressCss'=>true, 'combineJs'=>true, 'compressJs'=>true, ),
And you're set!
For more options see the comments in the file. To mention a few:
- excludeFiles: array with files not to be combined/compressed. Handy for some rarely used JS/CSS files.
- autoRefresh: If false, no check on filemtime() to speed up a bit more. Useful in production.
Change Log ¶
August 30, 2011: 0.9.0 ¶
- New version, using CssMin and JsMin (included). Several improvements of Sam included.
August 23, 2011: 0.4.1 ¶
- Automatic exclusion of remote files (JS as well as CSS), so you can use your CDN of choice. Thanks Kir!
- By popular demand: removal of DIRECTORY_SEPARATOR, changed to '/'
March 12, 2009 ¶
- Additional test to prevent E_ALL errors.
March 11, 2009 ¶
- Initial release.