Yii Playground: feedback / questions

Please use this topic to post your suggestions, questions and/or feedback about the Yii Playground project. Thanks.




I’ve uploaded a video so that you can get the idea without downloading it from svn…

At this stage it is not very useful for newbie users as a source of documentation but I hope that more experienced users will join us and help providing new examples.




I suggest you to open the video directly from youtube and expand it so you can see it 1:1



I suggest we organize the code as presented in PHP Cookbook - Solutions and examples of php programmers.



I am new to YII and like to study it with playground. I svned the code and can not make it work. Can your guys help me to install the playground step by step? Thanks

Hi shawn ;)

after you downloaded the source you just have to do a couple of steps:

  • copy the index-dist.php to index.php

  • edit the index.php file and set the path to your yii.php script (line #4)

at this point it should work ;) if you still get any error feel free to ask.

please not that at this moment there aren’t a lot of available examples as the project is quite new but I hope you’ll still find it useful ;)



Hi Giovanni,

Thanks for your reply. It works great. But I met one error when I clicked zii dialog:

PHP Error


Undefined variable: title

Source File


00007: * Declares class-based actions.

00008: */

00009: public function actions()

00010: {

00011: }



00014: public function actionIndex() {

00015: $this->render(‘index’);

00016: }


00018: public function actionZiiDialog() {

00019: $this->render(‘zii_dialog’, array(‘dialog_title’=>$title));

00020: }


00022: /**

00023: * Zii Datepicker widget

00024: */

00025: public function actionZiiDatePicker() {

00026: $this->render(‘zii_datepicker’);

00027: }


00029: }

Stack Trace

#0 D:\MyProjects\YII\source\framework\web\actions\CInlineAction.php(32): JuiController->actionZiiDialog()

#1 D:\MyProjects\YII\source\framework\web\CController.php(300): CInlineAction->run()

#2 D:\MyProjects\YII\source\framework\web\CController.php(278): JuiController->runAction()

#3 D:\MyProjects\YII\source\framework\web\CController.php(257): JuiController->runActionWithFilters()

#4 D:\MyProjects\YII\source\framework\web\CWebApplication.php(320): JuiController->run()

#5 D:\MyProjects\YII\source\framework\web\CWebApplication.php(120): CWebApplication->runController()

#6 D:\MyProjects\YII\source\framework\base\CApplication.php(135): CWebApplication->processRequest()

#7 D:\MyProjects\YII\source\yiiplayground\index.php(11): CWebApplication->run()

Hi shawn,

that was a bug due to dead code :P

if you svn update it now, it should work ;)




now two more examples are available: tabs and autocomplete!

The autocomplete tabs also uses the sqlite database to fetch data via ajax request; but of course the database (DAO and AR) is a topic that will be covered with more specific examples.




also added a first version of the CGridView demo ;)


Today PoL and Jaz Manister have just added to the project a couple of demos that are already available also on the live website. (Advanced ajax request and javascript callback for the JuiDialog!) And… as I wrote editing my previous message you can also see a CGridView demo.

On the wiki you can also find a new page with some information on how to join/getting started.




don’t forget to vote the poll attached to this thread ;)

This is exactly what Yii needs. The API is wonderful, and while it explains every class, method, and parameter, unless you’re familiar with how they all fit together, it can still be confusing for the newb. There should be an expansive menu tree, that perhaps uses mega menus, to allow anyone to add whatever examples they want. Each topic should have as many examples as people are willing to write, from simple to complex. Once I have time to play around with it, I’ll be sure to put back into it as I develop my sites.

Thanks for your feedback and of course your help will be more than welcome! This project to be successful needs to be reviewed, fine-tuned, extended from the community so it will always be up-to-date and then useful.

As I wrote on my other post, I think that now the structure is “feature-complete” that means that you can now organize examples and code in a way that should be maintainable during the evolving of the application, while of course there is still room for improvement but we can now focus on examples. Some takes very few time to be developed. The one that took me more time is the one about datetime i18n formats and I’m still looking for get some feedback about that cause is a topic that imho is a bit underestimated… ::)

Now that we are starting to have something useful, I’m also going to put a snapshot available to download (and other will follow as the app grows) on the google code page: http://code.google.com/p/yiiplayground/downloads/list so users will be able to get the code without having to use svn.




could you do me a favor!

i can’t download from google code because it’s forbidden for me :unsure:

upload to another svn repo

it can be a mirror to googlecode svn

tnx ::)


during July I’ll have less time to dedicate to this project so I hope the project will also get some new examples from people who joined and that other new users will join too ;)

Other users can also suggest new topic to be covered… for example I’d like to make a couple of examples about form validation and then move to the security topic (file upload / xss, csrf, and so on…) but other users can do it too if they have few free time ;)

Also… another minor task I plan to do is to update the widget based on CJuiWidget to use default theme from config using the new Yii 1.1.3 feature.



Hey, guys!

Giovanni and I have noticed the following behavior:

After upgrading Yiiplayground to Yii 1.1.3 and setting up the new widgetfactory property (default global prefs), our DatePicker example stopped showing the custom theme and always show the theme defined in the global prefs

In the config file;

// Common Jui Widget preferences:

$jui_prefs =array(








		'widgetFactory' => array(

			'widgets' => array(

				'CJuiDialog' => $jui_prefs,

				'CJuiTabs' => $jui_prefs,

				'CJuiDatePicker' => $jui_prefs,

				'CJuiAutoComplete' => $jui_prefs,






in modules/UiModule/view/jui/zii_datepicker.php




		/* optional: change visual

		 * themeUrl: "where the themes for this widget are located?"

		 * theme: theme name. Note that there must be a folder under themeUrl with the theme name

		 * cssFile: specifies the css file name under the theme folder. You may specify a

		 *          single filename or an array of filenames

		 * try http://jqueryui.com/themeroller/


		'themeUrl' => Yii::app()->baseUrl.'/css/jui' ,

		'theme'=>'pool',	//try 'bee' also to see the changes

		'cssFile'=>array('jquery-ui.css' /*,anotherfile.css, etc.css*/),


The reason for this is the rendered HTML code, which inserts both the global and custom css files in the view:

<link href="/css/jui/pool/jquery-ui.css" type="text/css" rel="stylesheet">

<link href="css/jui//base/jquery-ui.css" type="text/css" rel="stylesheet">

Shouldn’t Yii respect our custom “pool” theme and overwrite the global in this case? I mean, shouldn’t the custom theme be used instead of the “base” global theme in this case?

Or even, shouldn’t Yii render the base theme first and after the custom widget css theme?

Thanks for you help!



…anyone? is this a bug or did we made a mistake? ::) thanks.




I’ve put online a screencast that shows how to get started with the Yii Playground project! We need your help to keep this project active and make it grow, so if you have some experience with Yii that you want to share with other users please join!!



Hi everybody!

If you are not (yet ;D) a contributor of this project, you can anyway help us by posting here your wishlist: what examples would you like to see available on yii playground? How can we improve the existing ones? … ;)

Thanks, and please consider joining this project if you have some experience with Yii. I saw that the snapshot of source code available on the google code page raised more than 750 downloads and this is a good sign but this project must be the result of the collaboration between many users in order to be successful :)




I just tried to send PM to “Virtual DarKness” but I got error about that message cant be sent as this user doesn’t accept messages. ???

How could I join to Yii playground project in other way?