Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generator is not working #14

Closed
deep12650 opened this issue Jan 16, 2018 · 3 comments
Closed

Generator is not working #14

deep12650 opened this issue Jan 16, 2018 · 3 comments
Assignees

Comments

@deep12650
Copy link

deep12650 commented Jan 16, 2018

Hello Team,
You guys really did the good work. I have integrated it into my application as defined I am using a yii2 advance template but unable to add in GII tools. I have added following code to my frontend/config/main.php in component section:

'modules' => [
        'class' => 'yii\gii\Module',
            'generators' => [
                'email-templates' => [
                    'class' => \ymaker\email\templates\gii\Generator::class,
                    'templates' => [
                        'default' => '@vendor/yiimaker/yii2-email-templates/src/gii/default',
                    ],
                ],
            ],
    ],

Could you please guide me to implement it. I tried all ways and ran migration tool but no success. It is not showing email template generator in GII.

@greeflas
Copy link
Member

@deep12650 Hi, thank you! Check your frontend/config/main-local.php configuration file. In advance template configuration for Gii stored in that file.

@greeflas greeflas self-assigned this Jan 16, 2018
@deep12650
Copy link
Author

Thanks for your answer. I just put this code as per your document, I am getting error in ./yii migrate:
'controllerMap' => [

        'fixture' => [
            'class' => 'yii\console\controllers\FixtureController',
            'namespace' => 'common\fixtures',
          ],
        'migrate' => [
            'migrationNamespaces' => [
                'ymaker\email\templates\migrations',
            ],
        ],
    ],

Error:

Exception 'yii\base\InvalidConfigException' with message 'Object configuration must be an array containing a "class" element.'

in /Applications/MAMP/htdocs/zyv/vendor/yiisoft/yii2/BaseYii.php:353

Stack trace:
#0 /Applications/MAMP/htdocs/zyv/vendor/yiisoft/yii2/base/Module.php(583): yii\BaseYii::createObject(Array, Array)
#1 /Applications/MAMP/htdocs/zyv/vendor/yiisoft/yii2/base/Module.php(522): yii\base\Module->createController('')
#2 /Applications/MAMP/htdocs/zyv/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate', Array)
#3 /Applications/MAMP/htdocs/zyv/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('migrate', Array)
#4 /Applications/MAMP/htdocs/zyv/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(yii\console\Request))
#5 /Applications/MAMP/htdocs/zyv/yii(27): yii\base\Application->run()
#6 {main}

@greeflas
Copy link
Member

@deep12650 You don't set name of migration class controller. In your case configuration should be like following:

'migrate' => [
    'class' => 'yii\console\controllers\MigrateController',
    'migrationNamespaces' => [
        'ymaker\email\templates\migrations',
     ],
],

Please, read official Yii documentation for more info
https://www.yiiframework.com/doc-2.0/yii-console-controllers-migratecontroller.html

pptyasar added a commit to pptyasar/yii2-email-templates that referenced this issue Apr 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants