https://github.com/yii2-extensions/gii
Gii.
https://github.com/yii2-extensions/gii
branch-22 extension generator-code gii yii2
Last synced: 3 months ago
JSON representation
Gii.
- Host: GitHub
- URL: https://github.com/yii2-extensions/gii
- Owner: yii2-extensions
- License: mit
- Created: 2023-09-30T13:46:48.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-01T10:14:45.000Z (over 1 year ago)
- Last Synced: 2025-01-31T08:06:07.384Z (4 months ago)
- Topics: branch-22, extension, generator-code, gii, yii2
- Language: PHP
- Homepage: https://www.yiiframework.com
- Size: 218 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Gii.
## Installation
The preferred way to install this extension is through [composer](https://getcomposer.org/download/).
Either run
```
php composer.phar require --dev --prefer-dist yii2-extensions/gii
```or add
```
"yii2-extensions/gii": "dev-main"
```to the require-dev section of your `composer.json` file.
## Usage
Once the extension is installed, simply modify your application configuration as follows:
```php
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
```### Configure with yiisoft/config
> Add the following code to your `config/config-plugin` file in your application.
```php
'config-plugin' => [
'web' => [
'$yii2-gii', // add this line
'web/*.php'
],
],
```> For activate the gii generator, add in your config/params.php file in your application.
```php
return [
'yii2.gii' => true,
];
```> For change allowed IPs, add in your config/params.php file in your application.
```php
return [
'yii2.gii.allowedIPs' => ['192.168.1.1'],
];
```> For class map module, add in your config/params.php file in your application.
```php
use App\YourClass;return [
'yii2.gii.classMap' => [
'class' => YourClass::class,
],
];
```## Testing
[Check the documentation testing](/docs/testing.md) to learn about testing.
## Quality code
[](https://github.com/yii2-extensions/gii/actions/workflows/static.yml)
[](https://github.com/yii2-extensions/gii/actions/workflows/static.yml)
[](https://github.styleci.io/repos/698630757?branch=main)## Support versions Yii2
[](https://github.com/yiisoft/yii2/tree/2.0.49.3)
[](https://github.com/yiisoft/yii2/tree/2.2)## Our social networks
[](https://twitter.com/Terabytesoftw)
## License
The MIT License. Please see [License File](LICENSE.md) for more information.