You are viewing revision #1 of this wiki article.
This version may not be up to date with the latest version.
You may want to view the differences to the latest version.
This is a simple steps to put an analogue clock widget on your skeleton application that is just generated by yiic.
1. Get the files under the trunk using svn. ¶
$ svn checkout http://yii-analogue-clock-widget.googlecode.com/svn/trunk/ <yii-analogue-clock-widget>
2. Create a skeleton application using yiic. ¶
$ cd <yii-demo-directory>
$ ../framework/yiic webapp <app-name>
3. Copy image files and php files to the skeleton application. ¶
$ cp <yii-analogue-clock-widget>/analogue-clock-*.png <app-name>/images/
$ cp <yii-analogue-clock-widget>/Clock.php <app-name>/protected/components/
$ mkdir <app-name>/protected/components/views
$ cp <yii-analogue-clock-widget>/analogue-clock.php !$
4. Configure the config file (protected/config/main.php), with inserting a following line that indicates the zii search path. ¶
'import'=>array(
'application.models.*',
'application.components.*',
'zii.widgets.*', <<< this line
),
5. Change the layout from 'cloumn1' to 'column2' in the controller (protected/components/Controller.php). ¶
public $layout='//layouts/column2';
6. Add a widget call in the side bar in the view file (protected/views/layouts/column2.php). ¶
<?php $this->widget('Clock'); ?>
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.