Heim  >  Artikel  >  Backend-Entwicklung  >  Yii中使用Gii生成代码时碰到“Setting unknown property: yiiwebApplication::gii”

Yii中使用Gii生成代码时碰到“Setting unknown property: yiiwebApplication::gii”

WBOY
WBOYOriginal
2016-07-29 08:56:111789Durchsuche

??

Yii中使用Gii生成代码时碰到“Setting unknown property: yii\web\Application::gii”

针对Gii的使用:http://www.yiichina.com/doc/guide/2.0/start-gii 和 https://github.com/yiisoft/yii2/blob/master/docs/guide/start-gii.md ,我把下面这段直接放在$config = [。。。】;里面,然后就碰到了“Setting unknown property: yii\web\Application::gii”。

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

接着我尝试把这段代码放在“

$config['modules']['gii'] = [
'class'=>'yii\gii\Module',
];”里面,变成如下,就顺利运行成功了。

<span>$config['modules']['gii'] = [
        'class' => 'yii\gii\Module',
    	'allowedIPs' => ['127.0.0.1', '::1', '192.168.0.*', '10.231.113.187']
    ];</span>

所以这个文档还是有歧义的。

以上就介绍了Yii中使用Gii生成代码时碰到“Setting unknown property: yii\web\Application::gii”,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn