简体   繁体   中英

yii2 gii alhimik1986/yii2_crud_module

I try to install alhimik1986/yii2_crud_module but am getting this error:

Warning: Illegal string offset 'generators' in D:\\wamp64\\www\\ueb\\backend\\config\\main-local.php on line 21 ( ! ) Fatal error: Cannot use string offset as an array in D:\\wamp64\\www\\ueb\\backend\\config\\main-local.php on line 21

here is my config\\main-local.php

    <?php

$config = [
    'components' => [
        'request' => [
            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
            'cookieValidationKey' => 'PJYKlik7HzBS3KA95FBNwr87N9AgeQNg',
        ],
    ],
];

if (!YII_ENV_TEST) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = 'yii\debug\Module';

    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = 'yii\gii\Module';
}
if (YII_ENV_DEV) {
    $config['modules']['gii']['generators']['ajax_form_crud_generator'] = [
        'class' => 'alhimik1986\yii2_crud_module\generators\crud\Generator',
        'templates' => [
            'ajax_form_template' => '@vendor/alhimik1986/yii2_crud_module/generators/crud/default',
        ],
    ];
}
return $config;

please can someone help me

Change this part:

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'
    ];
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM