create costum generator yii2

Copy folder and file like the pic to common and create folder on common  costumtemplate like image 2
image 1

image 2
next configure yaour application common->main.php

if (YII_ENV_DEV) {
  // 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',
  'generators' => [ //here
      'crud' => [ // generator name
   'class' => 'common\costumtemplate\Generator', // generator class
   // 'templates' => [ //setting for out templates
   //     'lel' => '@common/costumtemplate/default', // template name => path to template
   // ]
      ]
  ],
  ];
}
return $config;

and set your namescpace generator to common\costumtemplate

Komentar

Postingan populer dari blog ini

cara menampilkan perulangan pada textbox menggunakan vb.net 2008