【问题标题】:yii2 gii alhimik1986/yii2_crud_moduleyii2 gii alhimik1986/yii2_crud_module
【发布时间】:2016-10-17 17:14:49
【问题描述】:

我尝试安装 alhimik1986/yii2_crud_module 但收到此错误:

警告:非法字符串偏移 'generators' in D:\wamp64\www\ueb\backend\config\main-local.php 在第 21 行(!)致命 错误:不能在第 21 行的 D:\wamp64\www\ueb\backend\config\main-local.php 中将字符串偏移用作数组

这是我的配置\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;

谁能帮帮我

【问题讨论】:

    标签: php yii2


    【解决方案1】:

    改变这部分:

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

    【讨论】:

      猜你喜欢
      • 2018-12-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-04
      • 1970-01-01
      • 1970-01-01
      • 2023-04-09
      • 1970-01-01
      相关资源
      最近更新 更多