Configuring GII


Before we can start using Gii, we have to configure it for use within our application.
At this point you probably know enough to guess we would do that in our main
application configuration file, protected/config/main.php. This is correct. To
configure Gii for use, open this file and add the following highlighted code to the
returned array:

return array(
‘basePath’=>dirname(__FILE__).DIRECTORY_SEPARATOR.’..’,
‘name’=>’My Web Application’,
// preloading ‘log’ component
‘preload’=>array(‘log’),
// autoloading model and component classes
‘import’=>array(
‘application.models.*’,
‘application.components.*’,
),
‘modules’=>array(
‘gii’=>array(
‘class’=>’system.gii.GiiModule’,
‘password’=>'[add_your_password_here]’,
),
),

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.