gii is a module in Yii. The gii module can be enabled by configuring the yii\base\Application::modules attribute. There will be the following configuration code in the config/web.php file:
$config = [ ... ]; if (YII_ENV_DEV) { $config['bootstrap'][] = 'gii'; $config['modules']['gii'] = 'yii\gii\Module'; }
After checking, I found that my configuration is the same as above, but why can’t I access it? It turns out there is another configuration. The above configuration means that if it is currently a development environment, the application will include the gii module, and the module class is yii\gii\Module. Next, let's go to the application's entry script web/index.php, and you will see the following code
efined('YII_ENV') or define('YII_ENV', 'dev');
Set YII_ENV_DEV to true, ok, and you can access it.
PHP Chinese website has a large number of free Yii introductory tutorials, everyone is welcome to learn!
The above is the detailed content of How to open gii in yii framework. For more information, please follow other related articles on the PHP Chinese website!