Gii modülüne eğer Enable pretty URLs işlemi yapılmışsa frontend/web/gii
adresinden yoksa frontend/web/index.php?r=gii
adresinden ulaşabiliriz.
Model Generator
Table Name:posts
Model Class:Posts
Namespace:app\models //frontend tarafına model ekler
Namespace:backend\models //backend tarafına model ekler.
CRUD Generator
Model Class: backend\models\Posts
Search Model Class: backend\models\PostsSearch Controller
Class: backend\controllers\PostsController
View Path: Boş bırakılırsa frontend tarafına eklenir.
backend tarafına eklemek istersek: View Path:C:\wamp\www\yii2\backend/views/posts
veya /home/sitename.com/demo/backend/views/mailsmtp
frontend/config/main-local.php
de aşağıda ki ayarları yapmak gerekecek.
if (!YII_ENV_TEST) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
];
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
'allowedIPs' => ['*'],#kapatınca gii modülüne giremez, Controller içinde ayarların da yapılması gerekir
#http://localhost/backend/web/index.php?r=gii
#http://localhost/gii eğer url manager yapılmışsa
#https://www.codevoila.com/post/21/enable-gii-module-in-yii2
];
}