nhockizi/yii2-gii

Yii2 custom generator for gii

Installs: 34

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2016-12-24 11:53 UTC

This package is auto-updated.

Last update: 2024-12-19 17:36:44 UTC


README

This generator generates two ActiveRecord class for the specified database table. An empty one you can extend and a Base one which is the same as the original model generatior.

Installation

The preferred way to install this extension is through composer.

Either run

$ php composer.phar require "nhockizi/yii2-gii": "dev-master"

or add

"nhockizi/yii2-gii": "dev-master"

to the require section of your composer.json file.

Usage

//if your gii modules configuration looks like below:
    $config['modules']['gii'] = 'yii\gii\Module';

//remove this lines
//Add this into common/config/main-local.php
    $config['modules']['gii'] = [
        'class' => 'yii\gii\Module',
        'generators' => [
            'Generator Model' => [
                'class' => 'nhockizi\gii\generators\model\Generator',
            ],
            'Generator Crud' => [
                'class'     => 'nhockizi\gii\generators\backend\Generator',
            ],
            'Generator Setup' => [
                'class'     => 'nhockizi\gii\generators\setup\Generator',
            ],
        ],
    ];

// create .htaccess in root files

prevent directory listings

Options -Indexes IndexIgnore /

follow symbolic links

Options FollowSymlinks

RewriteEngine on RewriteRule ^admin(.+)?$ backend/web/$1 [L,PT] RewriteRule ^(.+)?$ frontend/web/$1