Home  >  Article  >  PHP Framework  >  How to open gii in yii framework

How to open gii in yii framework

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-12-09 09:53:552550browse

How to open gii in yii framework

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn