O'Reilly logo

Yii2 By Example by Fabrizio Caldarelli

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Gii to create room, customer, and reservation models

Yii2 provides a powerful tool to generate models, controllers, and CRUD (create, read, update, and delete) actions, forms, modules, and extensions: Gii.

At the bottom of the basic/config/web.php file, placed in the basic standard configuration, there is a block of code that enables Gii:

if (YII_ENV_DEV) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = 'yii\debug\Module';

    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = 'yii\gii\Module';
}

Verify that these lines are present, otherwise append them at the bottom of the web.php file before the return $config statement. The last check is in basic/web/index.php. Verify ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required