yujin1st/gii-templates

yii2 gii templates

Installs: 1 059

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 0

Open Issues: 1

Type:yii2-extension

1.3 2019-05-06 07:30 UTC

This package is auto-updated.

Last update: 2024-05-06 19:29:46 UTC


README

Core template extends basic gii template for a few things:

  • Added scenarios and behavior methods to model
  • Commented sections in model
  • AccessController added to controller
  • Alert messages added to controller
  • Cancel button added to form

Install

The preferred way to install this extension is through composer.

Either run

$ php composer.phar require  yujin1st/gii-templates "@dev"

or add

"yujin1st/gii-templates": "@dev"

to the require section of your composer.json file.

Usage

Setup templates to gii configuration

 $config['modules']['gii'] = [
    'class' => 'yii\gii\Module',
    'generators' => [ 
      'crud' => [
        'class' => 'yii\gii\generators\crud\Generator',
        'templates' => [
          'core' => '@yujin1st/gii/core/crud',
        ]
      ],
      'model' => [
        'class' => 'yii\gii\generators\model\Generator',
        'templates' => [
          'core' => '@yujin1st/gii/core/model',
        ]
      ]
    ],
  ];