0

我正在尝试在我的 Yii-2 高级应用程序的后端实现 Metronic 主题。我一步一步按照 GitHub 上的说明进行操作,但是我不断收到一个空白页面,上面有以下错误。我真的被困住了。

这是错误:

An Error occurred while handling another error:
Error: Call to undefined method yii\base\ErrorException::getSeverity() in 
C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\ErrorHandler.php:287
Stack trace:
#0 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\ErrorHandler.php(107): 
yii\base\ErrorHandler->logException(Object(yii\base\ErrorException))
#1 [internal function]: yii\base\ErrorHandler-
>handleException(Object(yii\base\ErrorException))
#2 {main}
Previous exception:
yii\base\ErrorException: Illegal string offset 'id' in 
C:\xampp\htdocs\advanced\vendor\dlds\yii2-metronic\widgets\NavBar.php:59
Stack trace:
#0 C:\xampp\htdocs\advanced\vendor\dlds\yii2-
metronic\widgets\NavBar.php(59): yii\base\ErrorHandler->handleError(2, 
'Illegal string ...', 'C:\\xampp\\htdocs...', 59, Array)
#1 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\Object.php(107): 
dlds\metronic\widgets\NavBar->init()
#2 [internal function]: yii\base\Object->__construct(Array)
#3 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\di\Container.php(381): 
ReflectionClass->newInstanceArgs(Array)
#4 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\di\Container.php(156): 
yii\di\Container->build('dlds\\metronic\\w...', Array, Array)
#5 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\BaseYii.php(348): 
yii\di\Container->get('dlds\\metronic\\w...', Array, Array)
#6 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\Widget.php(89): 
yii\BaseYii::createObject(Array)
#7 C:\xampp\htdocs\advanced\backend\views\layouts\main.php(47): 
yii\base\Widget::begin(Array)
#8 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\View.php(330): 
require('C:\\xampp\\htdocs...')
#9 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\View.php(250): 
yii\base\View->renderPhpFile('C:\\xampp\\htdocs...', Array)
#10 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\Controller.php(396): 
yii\base\View->renderFile('C:\\xampp\\htdocs...', Array, 
Object(dektrium\user\controllers\SecurityController))
#11 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\Controller.php(382): 
yii\base\Controller->renderContent('\n\n    <div clas...')
#12 C:\xampp\htdocs\advanced\vendor\dektrium\yii2-                
user\controllers\SecurityController.php(166): yii\base\Controller-
>render('login', Array)
#13 [internal function]: dektrium\user\controllers\SecurityController-
>actionLogin()
#14 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\InlineAction.php(57): 
call_user_func_array(Array, Array)
#15 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\Controller.php(156): 
yii\base\InlineAction->runWithParams(Array)
#16 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\Module.php(523): 
yii\base\Controller->runAction('login', Array)
#17 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\web\Application.php(102): 
yii\base\Module->runAction('user/security/l...', Array)
#18 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\Application.php(380): 
yii\web\Application->handleRequest(Object(yii\web\Request))
#19 C:\xampp\htdocs\advanced\admin\index.php(15): yii\base\Application-
>run()
#20 {main}
4

1 回答 1

0

您必须在操作上添加“错误”

'rules' => [
               [
                  'actions' => ['error', ...
于 2018-09-14T04:15:46.453 回答