Home> php教程> PHP开发> body text

Yii2.0 uses Gii to generate code

伊谢尔伦
Release: 2016-11-25 14:29:29
Original
1007 people have browsed it

Open Gii

config/web.php:

$config = [ ... ]; if (YII_ENV_DEV) { $config['bootstrap'][] = 'gii'; $config['modules']['gii'] = 'yii\gii\Module'; }
Copy after login

Set YII_ENV_DEV in web/index.php:

defined('YII_ENV') or define('YII_ENV', 'dev');
Copy after login

If accessing from non-localhost, you need to make the following settings in the configuration file:

'gii' => [ 'class' => 'yii\gii\Module', 'allowedIPs' => ['127.0.0.1', '::1', '192.168.0.*', '192.168.178.20'] // adjust this to your needs ],
Copy after login

Test:

http://hostname/index.php?r=gii
Copy after login

Yii2.0 uses Gii to generate code

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 Recommendations
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!