dynamicres Compresses several CSS or JS in a single file (compressed) to minimize number of requests and maximize performance

  1. Dynamic Res
  2. Requirements
  3. Usage
  4. Auto SaveScheme
  5. Cache and Compress with GZIP
  6. Resources

Dynamic Res

Compress CSS or JS files in only one file to increase performance and decrease request of many files. This extension (version > 1.3) use CssMin and JavaScriptPacker to compress.

Requirements

assetManager (native)

Usage

  • Dowload the extension and put correctly in the extension folder
  • Add the following lines in your configuration file:

main.php

'components'=>array(
...
        'dynamicRes'=>array(
			'class' => 'application.extensions.DynamicRes.DynamicRes',
            'urlConfig' => array( // Its fix Css, and convert Url to RealName 
                'baseUrl'  => '/', // Url of your Site (ending with /), modify it if you use subdomain
                'basePath' => dirname(__FILE__).'/../../', // path of your site (ending with /) (No Change This)
            )
		),
...

In your layouts puts ~~~ ...

<?php Yii::app()->dynamicRes->registerCssFile(Yii::app()->request->baseUrl . '/css/style.css'); ?>
<?php Yii::app()->dynamicRes->registerCssFile(Yii::app()->request->baseUrl . '/css/reset.css'); ?>
<?php Yii::app()->dynamicRes->registerCssFile(Yii::app()->request->baseUrl . '/css/common.css'); ?>

...

8 0
20 followers
3 340 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Caching
Developed by: adsmail27
Created on: Aug 17, 2011
Last updated: 13 years ago

Downloads

show all

Related Extensions