标签:incr crud product auto alt DBName 模式 arc option
config/web.php
文件中会有以下配置代码开启该模块:
$config[‘bootstrap‘][] = ‘gii‘; $config[‘modules‘][‘gii‘] = [ ‘class‘ => ‘yii\gii\Module‘, // uncomment the following to add your IP if you are not connecting from localhost. //‘allowedIPs‘ => [‘127.0.0.1‘, ‘::1‘], ];
这段配置表明,如果当前是开发环境,应用会包含 gii
模块,模块类是 yii\gii\Module。
如果你检查应用的入口脚本 web/index.php
,将看到这行代码将 YII_ENV_DEV
设为 true:
‘gii‘ => [ ‘class‘ => ‘yii\gii\Module‘, ‘allowedIPs‘ => [‘127.0.0.1‘, ‘::1‘, ‘192.168.0.*‘, ‘192.168.178.20‘] // 按需调整这里//也可以添加在上面 ],
return [ ‘class‘ => ‘yii\db\Connection‘, ‘dsn‘ => ‘mysql:host=localhost;dbname=yii‘, ‘username‘ => ‘root‘, ‘password‘ => ‘root‘, ‘charset‘ => ‘utf8‘, // Schema cache options (for production environment) //‘enableSchemaCache‘ => true, //‘schemaCacheDuration‘ => 60, //‘schemaCache‘ => ‘cache‘, ];
CREATE TABLE `country` ( `id` int(11) NOT NULL AUTO_INCREMENT, `code` varchar(25) NOT NULL DEFAULT ‘ ‘, `name` varchar(220) NOT NULL DEFAULT ‘ ‘, `population` varchar(220) NOT NULL DEFAULT ‘ ‘, `createDate` datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00‘, PRIMARY KEY (`id`), UNIQUE KEY `code` (`code`), UNIQUE KEY `name` (`name`) ) ENGINE=MyISAM AUTO_INCREMENT=1027 DEFAULT CHARSET=utf8
标签:incr crud product auto alt DBName 模式 arc option
原文地址:https://www.cnblogs.com/wxdblog/p/9013274.html