scriptset Register 'sets' of CSS and Javascript Per Controller Action and Manage From A Single Location

  1. Documentation
  2. Change Log

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).


  • Yii 1.0 or above
  • Extract the release file under protected/components

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 (
		'setName2' => array (

	 * Define the Javascript sets below
	private $jsSets = array (
		'beans' => array (
		'setName2' => array (

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.
0 0
1 follower
Yii Version: 1.1
License: BSD-2-Clause
Category: Caching
Developed by: drech
Created on: Apr 22, 2009
Last updated: 10 years ago


show all