sorokinmedia / yii2-generators
Generators for Yii2(gii)
Installs: 36
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 6
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2-gii: ~2.0
Requires (Dev)
- phpunit/phpunit: 4.*
README
The extension allows to generate some types of classes on base of existing ActiveRecord
model class.
Installation
Install with composer:
composer require --dev ma3obblu/yii2-generators
or add
"ma3obblu/yii2-generators": "*"
to the require section of your composer.json
file.
Add new generator into your Gii module config:
$config['modules']['gii'] = [ 'class' => 'yii\gii\Module', 'generators' => [ 'crud' => [ 'class' => 'ma3obblu\gii\generators\crud\Generator', ], 'entity' => [ 'class' => 'ma3obblu\gii\generators\entity\Generator', ], 'form' => [ 'class' => 'ma3obblu\gii\generators\form\Generator', ], 'handler' => [ 'class' => 'ma3obblu\gii\generators\handler\Generator', ], 'fixture_class' => [ 'class' => 'ma3obblu\gii\generators\fixture_class\Generator', ], 'fixture_data' => [ 'class' => 'ma3obblu\gii\generators\fixture_data\Generator', ] ], ];
And add the following line:
Yii::setAlias('@tests', dirname(__DIR__) . '/tests');
in top of your config/web.php
file.