This extension provides a Web-based code generator, called Gii, for Yii framework 2.0 applications. You can use Gii to quickly generate models, forms, modules, CRUD, etc.
For license information check the LICENSE-file.
Documentation is at https://github.com/yiisoft/yii2-gii/blob/master/docs/guide/README.md.
The preferred way to install this extension is through composer.
Either run
php composer.phar require --dev --prefer-dist yiisoft/yii2-gii
or add
"yiisoft/yii2-gii": "~2.1.0"
to the require-dev section of your composer.json
file.
Once the extension is installed, simply modify your application configuration as follows:
return [
'bootstrap' => ['gii'],
'modules' => [
'gii' => [
'class' => 'yii\gii\Module',
],
// ...
],
// ...
];
You can then access Gii through the following URL:
http://localhost/path/to/index.php?r=gii
or if you have enabled pretty URLs, you may use the following URL:
http://localhost/path/to/index.php/gii
Using the same configuration for your console application, you will also be able to access Gii via command line as follows,
# 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
ExitCode::USAGE
on command input validation error (egmsystems)messageCategory
in Generator (rob006)::class
constant in model generator via the useClassConstant
setting (rhertogh)skipOnEmpty
to fix "trim(): Passing null to parameter" in generators/model/Generator.php
(rhertogh)generators/crud/default/controller
(WinterSilence, cjrf)moduleClass
in module generator (WinterSilence)assets/js/bs4-native.min.js
to the latest version (WinterSilence)ActionColumn::$urlCreator
in index template of CRUD generator (WinterSilence)enableI18N
and messageCategory
to Generator (WinterSilence)via()
junction relations in model generator (rhertogh)yii\gii\CodeFile
independent of controller context, do not apply $newDirMode
and $newFileMode
if module is not available (CeBe)Yii
from CRUD generator search model template (CeBe)null
value for integers when db is PostgreSQL (MKiselev)yii\db\Connection
(MKiselev)useTablePrefix
and generateQuery
to stickyAttributes
(luyi61)schema.table
as table name (SwoDs)yii\base\BaseObject
instead yii\base\Object
in CodeFile.php
(MKiselev)id_*
(mootensai, samdark)NotFoundHttpException
message in CRUD now uses i18n (bscheshirwork)ilike
operator when generating search model for PostgreSQL (MKiselev, arogachev)int
/bool
instead of integer
/boolean
in phpdoc blocks generated (MKiselev)else
after return
(bscheshirwork)yii\gii\generators\model\Generator
generateProperties
protected (claudejanz)@throws
tags for 404 exceptions in CRUD actions (and800)yii\gii\Module::defaultVersion()
implemented to pick up 'yiisoft/yii2-gii' extension version (klimov-paul)yii\rest\UrlRule
was used in UrlManager::ruleConfig
(lichunqiang)query.php
view of model generator (demisang)enablePjax
option to wrap GridView with Pjax (Faryshta, silverfire)Json::htmlEncode()
for safer JSON data encoding in HTML code (samdark, Tomasz Tokarski)yii\gii\generators\crud\Generator
to support customizing view path for the generated CRUD controller (qiangxue)--overwrite
option to Gii console command to support overwriting all files (motin, qiangxue)viaTable
expression in model generator (stepanselyuk)useTablePrefix
option to the model generator for Gii (horizons2)
Comments