How To Write The Extension For Yii

I am new to Yii and I am very impressed with the supersized Jquery pluging Supersized. Could you guys suggest me how to extend and write the plugin which I can use in my application.


Ashish Tyagi

I don’t understand your question.

Why don’t you just start using it already, what’s stopping you? :)

When you know how it works, you can start making a widget for it, and then turn it into an extension.

There are lots of extensions you can take a look at to learn how to do that. ;)

Thank you very much for your response. I am newbie and I don’t know how to include something at <head> of the page. I can do that by modifying the default layout(main.php) file but I do not want to alter the default layout file. Is there anyway I can include some script or css file in the header of the Yii page without modifying main layout file.


        $script = <<<EOD

   	// write pure javascript here without the need to escape


Yii::app()->clientScript->registerScript('customFnc', $script, CClientScript::POS_READY);?>

This is the third time I paste that bit of code today! :)

Btw: there is an equivalent function to insert a chunk of CSS, AFAIK.

Thank you very much for this. I can not thank you enough

My scripts doesn’t seems to read the image directory


$script= <<<EOD



    slide_interval          :7000,	// Length between transitions

transition              :1, 	// 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left

transition_speed	:1000,	// Speed of transition

slide_links		:'blank',// Individual links for each slide (Options: false, 'num', 'name', 'blank')

slides 			:[// Slideshow Images

			&#036;directory = Yii::getPathOfAlias('webroot').'/uploads/';

			&#036;images = glob(&#036;directory . &quot;*.{jpg,JPG,jpeg,JPEG,png,PNG}&quot;, GLOB_BRACE);

			foreach(&#036;images as &#036;image)

			echo &quot;{image : 'http://localhost/uploads/&quot; . &#036;image . &quot;', title : '&quot; .&#036;image . &quot;'},&quot;;





Yii::app()->clientScript->registerScript(‘customFnc’, $script, CClientScript::POS_READY);?>