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

How to open gii in yii framework

爱喝马黛茶的安东尼
Release: 2019-12-09 09:53:55
Original
2572 people have browsed it

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';
}
Copy after login

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');
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template