sadi01/yii2-giigenerator

Custom gii generators for Yii2 framework

Installs: 110

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 1

Type:yii2-extension

v1.0.0 2022-12-09 07:39 UTC

This package is not auto-updated.

Last update: 2024-11-09 16:06:35 UTC


README

Custom gii generators for Yii2 framework.

Installation

The preferred way to install this extension is through composer.

Either run console command

composer require sadi01/yii2-giigenerator "*"

Or add the package to the require section of your composer.json file:

{
    "require": {
      "sadi01/yii2-giigenerator": "*"
    }
}

then run composer update.

Usage

Once the extension is installed, simply use it in your config file :

...
'modules' => [
'gii' => [
            'class' => 'yii\gii\Module',
            'allowedIPs' => ['127.0.0.1', '::1'],
            'generators' => [
                'crud' => [
                    'class' => 'sadi01\giigenerator\generators\crud\Generator',
                    'templates' => [
                        'SADiCRUD' => '@vendor/sadi01/yii2-giigenerator/src/generators/crud/default',
                        'default' => '@vendor/yiisoft/yii2-gii/src/generators/crud/default',
                    ],
                ],
                'form' => [
                    'class' => 'sadi01\giigenerator\generators\form\Generator',
                    'templates' => [
                        'SADiForm' => '@vendor/sadi01/yii2-giigenerator/src/generators/form/default',
                        'default' => '@vendor/yiisoft/yii2-gii/src/generators/form/default',
                    ],
                ],
                'controller' => [
                    'class' => 'sadi01\giigenerator\generators\controller\Generator',
                    'templates' => [
                        'SADiController' => '@vendor/sadi01/yii2-giigenerator/src/generators/controller/default',
                        'default' => '@vendor/yiisoft/yii2-gii/src/generators/controller/default',
                    ],
                ],
                'module' => [
                    'class' => 'sadi01\giigenerator\generators\module\Generator',
                    'templates' => [
                        'SADiModule' => '@vendor/sadi01/yii2-giigenerator/src/generators/module/default',
                        'default' => '@vendor/yiisoft/yii2-gii/src/generators/module/default',
                    ],
                ],
                'model' => [
                    'class' => 'sadi01\giigenerator\generators\model\Generator',
                    'templates' => [
                        'SADiModel' => '@vendor/sadi01/yii2-giigenerator/src/generators/model/default',
                        'default' => '@vendor/yiisoft/yii2-gii/src/generators/model/default',
                    ],
                ],
            ],
        ]
]
...

?>