Hi,
I’ve tried to create my own Gii generator. If I use the following configuration and the following class, my console application cannot find the functions from my Generator class. What am I doing wrong? Any help would be appreciated (maybe you have an example from your own generator?).
<?php
return [
'id' => 'basic-console',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log', 'gii'],
'controllerNamespace' => 'app\commands',
'modules' => [
'gii' => 'yii\gii\Module',
'allowedIPs' => ['127.0.0.1', '::1', '192.168.0.*', '192.168.178.20'],
'generators' => [
'CasaControllerGenerator' => [
'class' => 'app\controllers\Generator',
'templates' => [
'my' => '@app/giiGeneratorTemplates/crud/default',
]
]
],
],
'components' => [
'cache' => [
'class' => 'yii\caching\MemCache',
'servers' => [
[
'host' => 'localhost',
'port' => 11211,
'weight' => 60,
]
],
],
'log' => [
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
],
];
?>
<?php
namespace giiGeneratorTemplates;
class Generator extends \yii\gii\Generator
{
public function getName()
{
return 'MY CRUD Generator';
}
public function getDescription()
{
return 'My crud generator. The same as a native, but he is mine...';
}
}