Browse Source

fix: 处理菜单初始化报错

wechat_public_accounts
iron 5 years ago
parent
commit
c4df588336
  1. 3
      vendor/blobt/widgets/Menu.php
  2. 24
      yii

3
vendor/blobt/widgets/Menu.php

@ -186,13 +186,14 @@ class Menu extends Widget {
*/ */
protected function renderItems($items) { protected function renderItems($items) {
$lines = []; $lines = [];
$n = count($items);
foreach ($items as $i => $item) { foreach ($items as $i => $item) {
/* 获取菜单项的自定义属性 */ /* 获取菜单项的自定义属性 */
$options = array_merge($this->itemOptions, ArrayHelper::getValue($item, 'options', [])); $options = array_merge($this->itemOptions, ArrayHelper::getValue($item, 'options', []));
$tag = ArrayHelper::remove($options, 'tag', 'li'); $tag = ArrayHelper::remove($options, 'tag', 'li');
$class = []; $class = [];
if ($item['active']) {
if (isset($item['active'])) {
$class[] = $this->activeCssClass; $class[] = $this->activeCssClass;
if (isset($item['items'])) { if (isset($item['items'])) {
$class[] = $this->menuOpenClass; $class[] = $this->menuOpenClass;

24
yii

@ -0,0 +1,24 @@
#!/usr/bin/env php
<?php
/**
* Yii console bootstrap file.
*/
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');
require __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/vendor/yiisoft/yii2/Yii.php';
require __DIR__ . '/common/config/bootstrap.php';
require __DIR__ . '/console/config/bootstrap.php';
$config = yii\helpers\ArrayHelper::merge(
require __DIR__ . '/common/config/main.php',
require __DIR__ . '/common/config/main-local.php',
require __DIR__ . '/console/config/main.php',
require __DIR__ . '/console/config/main-local.php'
);
$application = new yii\console\Application($config);
$exitCode = $application->run();
exit($exitCode);
Loading…
Cancel
Save