Closed zainalawaludin closed 8 years ago
controllerMap
should not be inside the components
array.
If you are unsure please paste your config file (after removing any sensitive information like passwords).
hi cornernote below this my config :
<?php
$params = require(__DIR__ . '/params.php');
$config = [
'id' => 'basic',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'components' => [
'authManager' => [
'class' => 'yii\rbac\DbManager'
],
'urlManager' => [
'class'=>'yii\web\UrlManager',
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
['class' => 'yii\rest\UrlRule',
'controller' => 'site',
'tokens' => [
'{message}' => '<message:\\d+>'
],
'extraPatterns' => [
'GET say/{message}' => 'say'
],
'pluralize' => false,
],
]
],
'cache' => [
'class' => 'yii\caching\FileCache',
],
'user' => [
'identityClass' => 'app\models\User',
'enableAutoLogin' => true,
'loginUrl' => ['site/login'],
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'db' => require(__DIR__ . '/db.php'),
],
'params' => $params,
'modules' =>[
'gridview' => [
'class' => '\kartik\grid\Module'
],
'admin' => [
'class' => 'mdm\admin\Module',
],
'audit' => 'bedezign\yii2\audit\Audit',
],
];
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',
];
}
return $config;
Hmm, we only use the controllerMap
feature in 1 place, the bootstrap functionality, and there is an explicit check that the current $app
instance is a console application (which normally has that feature as it's part of a Module). What version of Yii2 are you running?
hi blizzke i use YII2 version 2.0.5 basic
FYI i follow guide installation on this link https://bedezign.github.io/yii2-audit/docs/installation/ and in step migration found error
With the information we have so far it's impossible for us to determine what the problem is. Your config has no obvious issues. If you are able to get the actual exception stack trace and more info on from your logs, that might help us.
oke problem solved, my application is broken
hi i has install yii2-audit after install then i want to migration database but found error like this
Exception 'yii\base\InvalidConfigException' with message 'The configuration for the "controllerMap" component must contain a "class" element.'. thanks