Wallogit.com
2017 © Pedro Peláez
Yii2 custom generator for gii
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., (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
$ php composer.phar require "nhockizi/yii2-gii": "dev-master"
or add, (*4)
"nhockizi/yii2-gii": "dev-master"
to the require section of your composer.json file., (*5)
//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, (*6)
Options -Indexes IndexIgnore /, (*7)
Options FollowSymlinks, (*8)
RewriteEngine on RewriteRule ^admin(.+)?$ backend/web/$1 [L,PT] RewriteRule ^(.+)?$ frontend/web/$1, (*9)