myzero1 /
Yii2 自定义生成器 for gii
2.0.5
2017-12-07 07:32 UTC
Requires
- bower-asset/admin-lte: ^2.3.11
- bower-asset/flot: ^0.8
- bower-asset/font-awesome: ^4.0
- bower-asset/html5shiv: ^3.0
- bower-asset/jquery-slimscroll: ^1.3
- myzero1/yii2-upload: ~1.0.2
- yiidoc/yii2-redactor: *
- yiisoft/yii2: ~2.0
- yiisoft/yii2-gii: ~2.0
README
它添加了主题生成器和新的 CRUD 模板。它基于 yiisoft/yii2-gii
安装
安装此扩展的首选方式是通过 composer。
运行以下命令
php composer.phar require-dev myzero1/yii2-gii-plus:1.*
或者在您的 composer.json
文件的 require-dev 部分添加以下内容:
"myzero1/yii2-gii-plus": "~1.0.0"
设置
扩展安装完成后,只需按照以下方式修改您的应用程序配置:
... if (!YII_ENV_TEST) { $config['bootstrap'][] = 'myzero1'; $config['modules']['myzero1'] = [ 'class' => 'myzero1\yii2giiplus\Module', 'allowedIPs' => ['*'], // 'generators' => [ // 'myzero1_mvc' => ['class' => 'myzero1\yii2giiplus\generators\mvc\Generator'], // 'myzero1_crud' => [ // 'class' => 'myzero1\yii2giiplus\generators\crud\Generator', // 'templates' => [ // 'adminlte' => '@myzero1/gii/generators/theming/default/adminlte/_gii_templates/crud', // ], // 'template' => 'adminlte', // 'messageCategory' => 'backend' // ], // ] ]; }
用法
您可以通过以下 URL 访问 Gii:
http://localhost/path/to/index.php?r=myzero1
OR
http://localhost/path/to/index.php?r=myzero1/gii
或者如果您已启用漂亮 URL,您也可以使用以下 URL:
http://localhost/path/to/index.php/myzero1
OR
http://localhost/path/to/index.php/myzero1/gii