This extension is a very, very simple implementation of the CakePHP component 'Asset Manager'. You define sets of CSS and Javascript, then tell your controller actions to load whatever set is needed for that view.
This extension does not combine or compress any files, but works fine with the excellent 'extendedclientscript' that this extension is intended to complement (but not required).
Documentation ¶
Requirements ¶
- Yii 1.0 or above
Installation ¶
- Extract the release file under
protected/components
Usage ¶
It's super simple and almost not worth posting =)
First, define some sets within the release file itself:
/*
* Define the CSS sets below
*/
private $cssSets = array (
'groovy' => array (
'/css/some.css',
'/css/another.css',
'/css/ie_hacks_boo.css'
),
'setName2' => array (
'/css/some.css',
'/css/another.css',
'/css/common.css',
'/css/style.css'
),
);
/*
* Define the Javascript sets below
*/
private $jsSets = array (
'beans' => array (
),
'setName2' => array (
'/js/jquery/jquery.js',
'/js/uber.js',
'/js/obtrusive.js',
'/js/ruby_port.js'
),
);
then, in a controller action, load whatever CSS and JS sets you need for that view (the first argument is the CSS set, the second is the JS set):
$scriptSet = new ScriptSet;
$scriptSet->loadSet('groovy', 'beans');
Change Log ¶
April 21, 2009 ¶
- Initial release.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.