src/widgets/Menu.php
protected function guessModule(array $item, $parentUrl = null)
    {
        $result = false;
        $moduleId = Yii::$app->controller->module->id;
        $parentModuleId = $this->getModuleName($parentUrl);
        if (!empty($item['items'])) {
            foreach ($item['items'] as $i) {
                if (isset($i['url'])) {
                    $itemModuleName = $this->getModuleName(reset($i['url']));
                    if ($itemModuleName === $moduleId && $parentModuleId === $moduleId) {
                        $result = true;
                        break;
                    }
                }
            }
        }

        return $result;
    }
protected function guessModule(array $item, $parentUrl = null)
    {
        $result = false;
        $moduleId = Yii::$app->controller->module->id;
        $parentModuleId = $this->getModuleName($parentUrl);
        if (!empty($item['items'])) {
            foreach ($item['items'] as $i) {
                if (isset($i['url'])) {
                    $itemModuleName = $this->getModuleName(reset($i['url']));
                    if ($itemModuleName === $moduleId && $parentModuleId === $moduleId) {
                        $result = true;
                        break;
                    }
                }
            }
        }

        return $result;
    }
protected function guessModule ( array $ item , $ parentUrl = null ) { $ result = false ; $ moduleId = Yii :: $ app -> controller -> module -> id ; $ parentModuleId = $ this -> getModuleName ( $ parentUrl ) ; if ( ! empty ( $ item [ 'items' ] ) ) { foreach ( $ item [ 'items' ] as $ i ) { if ( isset ( $ i [ 'url' ] ) ) { $ itemModuleName = $ this -> getModuleName ( reset ( $ i [ 'url' ] ) ) ; if ( $ itemModuleName === $ moduleId && $ parentModuleId === $ moduleId ) { $ result = true ; break ; } } } } return $ result ; }
Try to guess which module is parent for current page
and remain sidebarmenu accordion opened.
@param array $item
@return bool
Try to guess which module is parent for current page and remain sidebarmenu accordion opened .