Wednesday, May 12, 2010

Using Gii

This feature is new to the 1.1.2 release of Yii. I finally had a chance to look at it today, and I'm quite impressed thus far. This module allows for web access to the old yiic shell commands, and is extremely straight forward and easy to use. It shows you previews of the files to be generated, including whether the file is new or overwriting an existing file. It comes with 5 default Generators: Controller, crud, Form, Model and Module.

To use it, you need to first enable it in your config for the site. Be sure to note that it's only set to work on a localhost by default, so if you need to use it on a remote machine make sure to enter in your IP to the IP filters array.  Also note that if you're configured for path urls, you're going to have to modify the settings there as directed in the guide.

The link to the guide for Gii is here:
http://www.yiiframework.com/doc/guide/topics.gii