public function canBuild(array $menus, sfActionStackEntry $action_entry) { if ($action_entry->getModuleName() == 'swBlogTagsAdmin') { return true; } return false; }
public function buildMenu(array $menus, sfActionStackEntry $action_entry) { $menus['main']->addChild(new swMenuElement(array('route' => 'swBlogPostsAdmin/index', 'name' => 'blog'))); if (preg_match('/swBlog*/', $action_entry->getModuleName())) { $menus['sidebar']->addChild(new swMenuElement(array('route' => 'swBlogPostsAdmin/index', 'name' => 'post', 'id' => 'swBlogPostsAdmin.index'))); $menus['sidebar']->addChild(new swMenuElement(array('route' => 'swBlogCommentsAdmin/index', 'name' => 'comments', 'id' => 'swBlogCommentsAdmin.index'))); $menus['sidebar']->addChild(new swMenuElement(array('route' => 'swBlogTagsAdmin/index', 'name' => 'tags', 'id' => 'swBlogTagsAdmin.index'))); } }