private function getMenuArray() { $current = $this->getCurrentAction(); $currentUrl = implode('/', $current); // $s = $this->session->get('a'); $menuArr = ApplicationConfig::getMenu($this->session); // Compare current Url to active the menu group $activeSet = false; foreach ($menuArr as &$i) { $subMenu = $i['sub_menus']; foreach ($subMenu as $s) { $url = $s['url']; // file_put_contents("d:\\m.txt", "$url, $currentUrl\n", FILE_APPEND); // 隐含BUG: 当两个路径分别在不同的Menu中, 但是Path是$currentUrl的字串的时候, Menu红色高亮可能有问题 if (strstr($currentUrl, $url)) { $i['active'] = true; $activeSet = true; break; } } if ($activeSet) { break; } } if (!$activeSet) { } return $menuArr; }