奋豆1990
官方最新版本(2.6.0)已经解决了这个问题,可以达到子菜单级别的高亮:
` /*** Checks whether a menu item is active. * This is done by checking if [[route]] and [[params]] match that specified in the `url` option of the menu item. * When the `url` option of a menu item is specified in terms of an array, its first element is treated * as the route for the item and the rest of the elements are the associated parameters. * Only when its route and parameters match [[route]] and [[params]], respectively, will a menu item * be considered active. * @param array $item the menu item to be checked * @return boolean whether the menu item is active */ protected function isItemActive($item) { if (isset($item['url']) && is_array($item['url']) && isset($item['url'][0])) { $route = $item['url'][0]; if ($route[0] !== '/' && Yii::$app->controller) { $route = ltrim(Yii::$app->controller->module->getUniqueId() . '/' . $route, '/'); } $route = ltrim($route, '/'); if ($route != $this->route && $route !== $this->noDefaultRoute && $route !== $this->noDefaultAction) { return false; } unset($item['url']['#']); if (count($item['url']) > 1) { foreach (array_splice($item['url'], 1) as $name => $value) { if ($value !== null && (!isset($this->params[$name]) || $this->params[$name] != $value)) { return false; } } } return true; } return false; }`
我用的最新版,也不能显示,不知道是不是自己写的有问题!
- 奋豆1990 2017-07-24 已签到连续签到1天,获得了5个金钱
- 奋豆1990 2017-07-06 已签到连续签到1天,获得了5个金钱
- 奋豆1990 2016-08-11 已签到连续签到1天,获得了5个金钱
- 奋豆1990 2016-07-19 已签到连续签到1天,获得了5个金钱
- 奋豆1990 2016-06-27 已签到连续签到1天,获得了5个金钱
- 奋豆1990 2016-04-19 已签到连续签到1天,获得了5个金钱
- 奋豆1990 收藏了教程ActiveForm的使用方法