controller()); $action = strtolower($request->action()); $controller = str_replace('manager.', '', $controller); $name = $controller . '/' . $action; if($action == 'index'){ $rule = AuthRule::getByTwoName($name, $controller); }else{ $rule = AuthRule::getByName($name); } $parent = []; if(!empty($rule) && $rule['parent_id']){ $parent = AuthRule::getById($rule['parent_id']); } $cateCrumbs = []; $isContent = false; if($controller == 'content') { $isContent = true; $categoryId = $request->param('category_id', 0); if (is_numeric($categoryId) && $categoryId > 0) { $cateCrumbs = Category::getCatesCrumbs($categoryId); } } $data = [ 'rule' => $rule, 'parent' => $parent, 'isContent' => $isContent, 'cateCrumbs' => $cateCrumbs ]; return View::assign($data)->fetch('manager/widget/crumbs'); } }