奋豆1990

奋豆1990

这家伙有点懒,还没写个性签名!

  • 财富值115
  • 威望值0
  • 总积分275

个人信息

  • 回复了 的评论

    官方最新版本(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;
    }`
    

    我用的最新版,也不能显示,不知道是不是自己写的有问题!

  • 2017-07-24 已签到
    连续签到1天,获得了5个金钱
  • 2017-07-06 已签到
    连续签到1天,获得了5个金钱
  • 2016-08-11 已签到
    连续签到1天,获得了5个金钱
  • 2016-07-19 已签到
    连续签到1天,获得了5个金钱
  • 2016-06-27 已签到
    连续签到1天,获得了5个金钱
  • 2016-04-19 已签到
    连续签到1天,获得了5个金钱
  • 收藏了教程
    ActiveForm的使用方法
见习主管 等级规则
275/500
资料完整度
20/100
用户活跃度
0/100

Ta的关注

0

Ta的粉丝

1

Ta的访客

4