Yii 1.1: scriptset

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

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.

Be the first person to leave a comment

Please to leave your comment.

Create extension
  • Yii Version: 1.1
  • License: New BSD License
  • Developed by: drech
  • Category: Caching
  • Votes: No votes yet
  • Downloaded: 555 times
  • Created on: Apr 22, 2009
  • Last updated: never