kv4nt / yii2-gii
为 Yii 框架提供的 Gii 扩展
1.0.2
2022-11-10 07:38 UTC
Requires
- phpspec/php-diff: ^1.1.0
- rcnowak/yii2: 1.0
Requires (Dev)
- cweagans/composer-patches: ^1.7
- phpunit/phpunit: 4.8.34
- yiisoft/yii2-coding-standards: ~2.0
This package is auto-updated.
Last update: 2024-09-10 11:28:01 UTC
README
为 Yii 2 的 Gii 扩展
此扩展提供了一个基于 Web 的代码生成器,称为 Gii,用于 Yii 框架 2.0 应用程序。您可以使用 Gii 快速生成模型、表单、模块、CRUD 等。
有关许可证信息,请查看 LICENSE 文件。
文档位于 docs/guide/README.md。
安装
安装此扩展的首选方式是通过 composer。
运行以下命令之一
php composer.phar require --dev --prefer-dist yiisoft/yii2-gii
或向您的 composer.json
文件的 require-dev 部分添加
"yiisoft/yii2-gii": "~2.1.0"
。
使用方法
扩展安装完成后,只需按以下方式修改您的应用程序配置
return [ 'bootstrap' => ['gii'], 'modules' => [ 'gii' => [ 'class' => 'yii\gii\Module', ], // ... ], // ... ];
您可以通过以下 URL 访问 Gii
https:///path/to/index.php?r=gii
如果已启用美观的 URL,您还可以使用以下 URL
https:///path/to/index.php/gii
使用与您的控制台应用程序相同的配置,您还可以通过以下命令行访问 Gii
# change path to your application's base path
cd path/to/AppBasePath
# show help information about Gii
yii help gii
# show help information about the model generator in Gii
yii help gii/model
# generate City model from city table
yii gii/model --tableName=city --modelClass=City