本文整理汇总了PHP中Knp\Menu\FactoryInterface类的典型用法代码示例。如果您正苦于以下问题:PHP FactoryInterface类的具体用法?PHP FactoryInterface怎么用?PHP FactoryInterface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FactoryInterface类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: fabMenu
public function fabMenu(FactoryInterface $factory)
{
/**
* @var Journal $journal
* @var AuthorizationChecker $checker
*/
$dispatcher = $this->container->get('event_dispatcher');
$checker = $this->container->get('security.authorization_checker');
$menu = $factory->createItem('root')->setChildrenAttribute('class', 'dropdown-menu dropdown-menu-right');
$menu->addChild('dashboard', ['route' => 'dashboard', 'attributes' => array('data-toggle' => 'tooltip', 'data-placement' => 'left'), 'extras' => ['icon' => 'dashboard']]);
$journal = $this->container->get('ojs.journal_service')->getSelectedJournal();
if ($journal) {
$journalId = $journal->getId();
if ($checker->isGranted('CREATE', $journal, 'articles')) {
$menu->addChild('article.submit', ['route' => 'ojs_journal_submission_new', 'routeParameters' => ['journalId' => $journalId], 'attributes' => array('data-toggle' => 'tooltip', 'data-placement' => 'left'), 'extras' => ['icon' => 'file-text']]);
}
if ($checker->isGranted('EDIT', $journal, 'userRole')) {
$menu->addChild('title.users', ['route' => 'ojs_journal_user_index', 'routeParameters' => ['journalId' => $journalId], 'attributes' => array('data-toggle' => 'tooltip', 'data-placement' => 'left'), 'extras' => ['icon' => 'key']]);
}
if ($checker->isGranted('EDIT', $journal, 'issues')) {
$menu->addChild('title.issues', ['route' => 'ojs_journal_issue_index', 'routeParameters' => ['journalId' => $journalId], 'attributes' => array('data-toggle' => 'tooltip', 'data-placement' => 'left'), 'extras' => ['icon' => 'plug']]);
}
if ($checker->isGranted('VIEW', $journal, 'articles')) {
$menu->addChild('articles', ['route' => 'ojs_journal_submission_me', 'routeParameters' => ['journalId' => $journalId], 'attributes' => array('data-toggle' => 'tooltip', 'data-placement' => 'left'), 'extras' => ['icon' => 'file-o']]);
}
}
$menuEvent = new MenuEvent();
$menuEvent->setMenuItem($menu);
$dispatcher->dispatch(MenuEvents::FAB_MENU_INITIALIZED, $menuEvent);
return $menuEvent->getMenuItem();
}
开发者ID:beyzakokcan,项目名称:ojs,代码行数:31,代码来源:MenuBuilder.php
示例2: footerMenu
public function footerMenu(FactoryInterface $factory, array $options)
{
$menuOptions = array_merge($options, ['childrenAttributes' => ['class' => 'dark-main-color nav navbar-nav navbar-center', 'id' => 'footer-nav']]);
$menu = $factory->createItem('footer', $menuOptions);
$this->addSharedItemsToMenu($menu, $this->sharedMenuItems);
return $menu;
}
开发者ID:Richard-NL,项目名称:sonata,代码行数:7,代码来源:Builder.php
示例3: mainMenu
/**
* Set main menu
*
* @param FactoryInterface $factory
* @param array $options
*
* @return \Knp\Menu\MenuItem
*/
public function mainMenu(FactoryInterface $factory, array $options)
{
$menu = $factory->createItem('root');
$menu->addChild('Home', array('route' => 'homepage'))->setLinkAttribute('title', 'Back to the home page');
$menu->addChild('Home', array('route' => 'homepage'));
return $menu;
}
开发者ID:javierugalde,项目名称:symfony2-quiz,代码行数:15,代码来源:Builder.php
示例4: mainMenu
public function mainMenu(FactoryInterface $factory, array $options)
{
//$requestStack = $this->container->get('request_stack');
//$request = $requestStack->getCurrentRequest();
$user = $this->container->get('security.context')->getToken()->getUser();
$user_role = null;
if (method_exists($user, 'getRole')) {
$user_role = $user->getRole();
}
$menu = $factory->createItem('Navigation')->setChildrenAttributes(array('class' => 'navigation widget'));
/*
* Tableau de bord
*/
$menu->addChild('Tableau de bord', array('route' => 'core_dashboard'))->setAttribute('icon', 'icon-dashboard');
$menu->addChild('Suivie des articles')->setUri('#')->setAttribute('icon', 'icon-tasks')->setLinkAttribute('class', 'expand');
$menu['Suivie des articles']->addChild('Liste des articles', array('route' => 'articles'));
$menu['Suivie des articles']->addChild('Liste des commentaires', array('route' => 'commentaire'));
$menu->addChild('Administration')->setUri('#')->setAttribute('icon', 'icon-group')->setLinkAttribute('class', 'expand');
$menu['Administration']->addChild('Gérer les membres', array('route' => 'utilisateur'));
$menu['Administration']->addChild('Membres premium', array('route' => 'utilisateur_premium'));
$menu['Administration']->addChild('Gestion des flux RSS', array('route' => 'flux_rss'));
$menu['Administration']->addChild('Gestion des articles', array('route' => 'article_flux_rss'));
$menu['Administration']->addChild('Gérer les pays', array('route' => 'pays'));
$menu['Administration']->addChild('Gestion des blocs affichés', array('route' => 'bloc'));
$menu['Administration']->addChild('Gestion des sondages', array('route' => 'sondage'));
return $menu;
}
开发者ID:Bobarisoa,项目名称:noucoz-release,代码行数:27,代码来源:Navigation.php
示例5: mainMenu
public function mainMenu(FactoryInterface $factory, array $options)
{
$token = $this->container->get('security.token_storage')->getToken();
$checker = $this->container->get('security.authorization_checker');
//$user = $token->getUser()->getRoles();
//dump($user);
$menu = $factory->createItem('root');
$menu->addChild('Start', ['route' => 'app_homepage']);
if ($checker->isGranted(USER::ROLE_ADMIN)) {
$menu->addChild('Dodaj ogłoszenie', array('route' => 'add_product'));
$menu->addChild('Add House', array('route' => 'house_add'));
$menu->addChild('Dodaj miasto', array('route' => 'category_add'));
$menu->addChild('Konto', array('route' => 'account'));
$menu->addChild('Rejestracja', array('route' => 'register_account'));
$menu->addChild('Konta', array('route' => 'view_account'));
$menu->addChild('Dodaj mieszkańie', array('route' => 'house_add'));
$menu->addChild('Zobacz mieszkania', array('route' => 'house_view'));
}
if ($checker->isGranted(USER::ROLE_USER)) {
$menu->addChild('Add Product', array('route' => 'add_product'));
$menu->addChild('View House', array('route' => 'house_view'));
$menu->addChild('View Profiles', array('route' => 'allproduct'));
$menu->addChild('Account', array('route' => 'account'));
} else {
$menu->addChild('Zarejestruj się!', array('route' => 'register_account'));
$menu->addChild('Zobacz profile', array('route' => 'allproduct'));
$menu->addChild('Zobacz mieszkania', array('route' => 'house_view'));
}
//$menu->addChild('Messages', array('route' => 'messages'));
// ... add more children
return $menu;
}
开发者ID:highcmd,项目名称:home,代码行数:32,代码来源:Builder.php
示例6: mainMenu
public function mainMenu(FactoryInterface $factory, array $options)
{
$menu = $factory->createItem('root');
$menu->setChildrenAttribute('class', 'nav navbar-nav navbar-right');
//ul
if ($this->container->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
$menu->addChild('userInfo', array());
}
if ($this->container->get('request')->get('_route') == 'default_homepage') {
$menu->addChild('homePage', array('route' => 'default_homepage', 'label' => '首页'))->setAttribute('class', 'active')->setLabelAttribute('class', 'sr-only');
} else {
$menu->addChild('homePage', array('route' => 'default_homepage', 'label' => '首页'));
}
$menu->addChild('report', array('route' => 'default_homepage', 'label' => '上报故障'));
$menu->addChild('RepairForm', array('route' => 'default_homepage', 'label' => '我的工单'))->setAttribute('class', 'dropdown')->setLinkAttribute('class', 'dropdown-toggle')->setLinkAttribute('data-toggle', 'dropdown')->setLinkAttribute('role', 'button')->setLinkAttribute('aria-haspopup', 'true')->setLinkAttribute('aria-expanded', 'false')->setLabelAttribute('class', 'caret')->setChildrenAttribute('class', 'dropdown-menu');
//ul
$menu['RepairForm']->addChild('myRepairForm', array('route' => 'default_homepage', 'label' => '我的工单'));
$menu['RepairForm']->addChild('reportHistory', array('route' => 'reported_history', 'label' => '历史记录'));
// access services from the container!
$em = $this->container->get('doctrine')->getManager();
// findMostRecent and Blog are just imaginary examples
/*
$blog = $em->getRepository('AppBundle:Blog')->findMostRecent();
$menu->addChild('Latest Blog Post', array(
'route' => 'blog_show',
'routeParameters' => array('id' => $blog->getId())
));
*/
// create another menu item
// ... add more children
return $menu;
}
开发者ID:nistlrooy,项目名称:repairsystem,代码行数:33,代码来源:Builder.php
示例7: mainMenu
public function mainMenu(FactoryInterface $factory, array $options)
{
$menu = $factory->createItem('root');
$em = $this->container->get('doctrine')->getManager();
/**
* @var Player $player
*/
$player = $this->container->get('security.token_storage')->getToken()->getUser();
$menu->setChildrenAttribute('class', 'sidebar-menu');
$menu->addChild('Dash', array('route' => '_index'));
// // findMostRecent and Blog are just imaginary examples
// $blog = $em->getRepository('AppBundle:Blog')->findMostRecent();
// $menu->addChild('Latest Blog Post', array(
// 'route' => 'blog_show',
// 'routeParameters' => array('id' => $blog->getId())
// ));
// create another menu item
$menu->addChild('Auctions', array('route' => 'view_auctions'));
if ($player->hasActiveCar()) {
$menu->addChild('Garage', array('route' => 'view_garage'));
$menu->addChild('Go Touge', array('uri' => 'javascript:;', 'attributes' => array('class' => 'sub-menu'), 'childrenAttributes' => array('class' => 'sub')));
$availableTracks = $em->getRepository('ZaZakretemModelsBundle:Track')->findAll();
foreach ($availableTracks as $track) {
$menu['Go Touge']->addChild($track->getName(), array('route' => 'view_track', 'routeParameters' => array('trackId' => $track->getId())));
}
}
// you can also add sub level's to your menu's as follows
// $menu['About Me']->addChild('Edit profile', array('route' => 'edit_profile'));
// ... add more children
return $menu;
}
开发者ID:BelegUS,项目名称:zazakretem_game,代码行数:31,代码来源:Builder.php
示例8: mainMenu
public function mainMenu(FactoryInterface $factory, array $options)
{
$menu = $factory->createItem('root');
// $menu->setAttribute('class', 'left');
$menu->setChildrenAttribute('class', 'left');
$securityContext = $this->container->get('security.context');
if ($securityContext->isGranted('ROLE_SCHEDULE')) {
$menu->addChild('Phân lịch', array('route' => 'qtu_tkb_timetable_builder'));
}
if ($securityContext->isGranted('ROLE_SCHEDULE') || $securityContext->isGranted('ROLE_LECTUREHALL')) {
$menu->addChild('Sử dụng phòng', array('route' => 'qtu_tkb_room_byweek'));
}
if ($securityContext->isGranted('IS_AUTHENTICATED_FULLY')) {
$menu->addChild('Lịch cá nhân', array('route' => 'qtu_tkb_mytimetable'));
}
// $menu->addChild('Thời khóa biểu', array('route' => 'qtu_tkb_timetable'));
$menu->addChild('Thời gian biểu', array('route' => 'qtu_tkb_time'));
$menu->addChild('Liên hệ', array('route' => 'qtu_common_contact'));
$menu->addChild('Về chúng tôi', array('route' => 'qtu_tkb_about'));
if ($securityContext->isGranted('ROLE_ADMIN')) {
$menu->addChild('Quản trị', array('route' => 'sonata_admin_dashboard'));
}
// $menu['root']->setAttribute('class', 'left');
return $menu;
}
开发者ID:princedominh,项目名称:tkb,代码行数:25,代码来源:Builder.php
示例9: mainMenu
public function mainMenu(FactoryInterface $factory, array $options)
{
$menu = $factory->createItem('root');
$menu->setChildrenAttribute('class', 'navbar-nav nav');
$menu->addChild('Stojimas į JK')->setExtra('translation_domain', 'messages')->setAttribute('dropdown', true);
$menu['Stojimas į JK']->addChild('Oksbridžo etapas', array('route' => 'about_oxbridge'))->setExtra('translation_domain', 'messages');
$menu['Stojimas į JK']->addChild('JK (II-asis) etapas', array('route' => 'about_uk'))->setExtra('translation_domain', 'messages');
$menu['Stojimas į JK']->addChild('Mentoriai', array('route' => 'mentor_list'))->setExtra('translation_domain', 'messages');
$menu->addChild('Stojimas į JAV')->setExtra('translation_domain', 'messages')->setAttribute('dropdown', true);
$menu['Stojimas į JAV']->addChild('Apie JAV etapą', array('route' => 'about_usa'))->setExtra('translation_domain', 'messages');
$menu['Stojimas į JAV']->addChild('JAV mentoriai', array('route' => 'about_usa_mentors'))->setExtra('translation_domain', 'messages');
$menu['Stojimas į JAV']->addChild('Registracija', array('uri' => 'https://goo.gl/forms/thkpGrMSRJiHLdmZ2'))->setExtra('translation_domain', 'messages');
$menu->addChild('Apie mus', array('route' => 'about_ab'))->setExtra('translation_domain', 'messages');
/*$menu->addChild('Parama', array(
'route' => 'support'
))->setExtra('translation_domain', 'messages');*/
/*$securityContext = $this->container->get('security.context');
if ($securityContext->isGranted('ROLE_ADMIN')) {
$menu->addChild('Moksleiviai', array(
'route' => 'pupil_list'
));
$menu->addChild('El. paštai', array(
'route' => 'user_export'
));
}*/
return $menu;
}
开发者ID:eliberis,项目名称:academicbuddy,代码行数:29,代码来源:Builder.php
示例10: userMenu
public function userMenu(FactoryInterface $factory, array $options)
{
$menu = $factory->createItem('root');
$menu->setChildrenAttribute('class', 'nav navbar-nav navbar-right');
// $menu->addChild('User', array('label' => 'Hi visitor'))
// ->setAttribute('dropdown', true)
// ->setAttribute('icon', 'gl gl-user');
// $menu['User']->addChild('Edit profile', array('uri' => '#'))
// ->setAttribute('icon', 'fa fa-edit');
// $menu['User']->addChild('Menu Item', array('uri' => '#'));
// $menu['User']->addChild('Menu Item', array('uri' => '#'));
// $menu['User']->addChild('Menu Item', array('uri' => '#'));
// access servies from the container!
//$em = $this->container->get('doctrine')->getManager();
$securityContext = $this->container->get('security.authorization_checker');
if ($securityContext->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
$username = $this->container->get('security.context')->getToken()->getUser()->getUsername();
// Get username of the current logged in user
$menu->addChild('User')->setAttribute('dropdown', true)->setAttribute('divider_prepend', true);
$menu['User']->addChild("Hello {$username}");
$menu['User']->addChild('Edit profile', array('route' => 'fos_user_profile_edit'))->setAttribute('icon', 'glyphicon glyphicon-user');
$menu['User']->addChild('Logout', array('route' => 'fos_user_security_logout'));
} else {
$menu->addChild('Login', array('route' => 'fos_user_security_login'));
}
return $menu;
}
开发者ID:broadcasttechie,项目名称:theatresignage-server,代码行数:27,代码来源:Builder.php
示例11: optionMenu
public function optionMenu(FactoryInterface $factory, array $options)
{
$menu = $factory->createItem('root');
$menu->addChild('Profil', array('route' => 'symbb_user_options', 'routeParameters' => array()))->setExtra('translation_domain', 'symbb_frontend');
$menu->addChild('Security', array('route' => 'symbb_user_options_security'))->setExtra('translation_domain', 'symbb_frontend');
return $menu;
}
开发者ID:symbb,项目名称:symbb,代码行数:7,代码来源:Builder.php
示例12: rolesNewMenu
public function rolesNewMenu(FactoryInterface $factory, array $options)
{
$menu = $factory->createItem('root');
$menu->setChildrenAttribute('class', 'menu-plus');
$menu->addChild('+', array('route' => 'artesanus_console_acl_roles_new'))->setAttribute('icon', 'icon-list');
return $menu;
}
开发者ID:ArtesanIO,项目名称:ArtesanusBundle,代码行数:7,代码来源:ConsoleBuilder.php
示例13: mainMenu
public function mainMenu(FactoryInterface $factory, array $options)
{
$menu = $factory->createItem('root');
$menu->addChild('Home', array('route' => 'start'));
$menu->addChild('About Me', array('route' => ''));
return $menu;
}
开发者ID:AlexNosach,项目名称:boile,代码行数:7,代码来源:Builder.php
示例14: userMenu
public function userMenu(FactoryInterface $factory, array $options)
{
$menu = $factory->createItem('root');
$menu->addChild('Выход', array('route' => 'fos_user_security_logout'));
$menu->setCurrent($this->container->get('request')->getRequestUri());
return $menu;
}
开发者ID:olegfox,项目名称:landing,代码行数:7,代码来源:BackendMenuBuilder.php
示例15: generateMenu
/**
* @param FactoryInterface $factory
* @param array $items
* @param null $event
* @return \Knp\Menu\ItemInterface
*/
private function generateMenu(FactoryInterface $factory, $items = [], $event = null)
{
/**
* @var Journal $journal
* @var AuthorizationChecker $checker
*/
$dispatcher = $this->container->get('event_dispatcher');
$menu = $factory->createItem('root')->setChildrenAttribute('class', 'list-unstyled');
foreach ($items as $item) {
$label = $item[0];
$path = $item[1];
$icon = $item[2];
$unreadFeedbackCount = 0;
if (isset($item[3])) {
$unreadFeedbackCount = $item[3];
}
$menu->addChild($label, ['route' => $path, 'extras' => ['icon' => $icon, 'unreadFeedbackCount' => $unreadFeedbackCount]]);
}
$menuEvent = new MenuEvent();
$menuEvent->setMenuItem($menu);
if (!is_null($event)) {
$dispatcher->dispatch($event, $menuEvent);
}
return $menuEvent->getMenuItem();
}
开发者ID:beyzakokcan,项目名称:ojs,代码行数:31,代码来源:MenuBuilder.php
示例16: mainMenu
public function mainMenu(FactoryInterface $factory, array $options)
{
$menu = $factory->createItem('root');
$menu->setChildrenAttribute('class', 'nav navbar-nav');
$menu->addChild('homepage', array('route' => 'homepage'))->setExtra('translation_domain', 'blog');
$em = $this->container->get('doctrine')->getManager();
$posts = $em->getRepository('BeluhaBlogBundle:Post')->findAll();
$menu->addChild('posts')->setAttribute('icon', 'fa fa-list')->setAttribute('dropdown', true)->setExtra('translation_domain', 'blog');
foreach ($posts as $post) {
$menu['posts']->addChild($post->getTitle(), array('route' => 'beluha_blog_post_show', 'routeParameters' => array('slug' => $post->getSlug())));
}
#$em = $this->container->get('doctrine')->getManager();
// findMostRecent and Blog are just imaginary examples
#$authors = $em->getRepository('BeluhaBlogBundle:AuthorQuote')->findAll();
//$menu->addChild('Авторы', array('route' => 'authorquote_index'))->setAttribute('icon', 'fa fa-list')->setAttribute('dropdown', true);
#$menu->addChild('authors')->setAttribute('icon', 'fa fa-list')->setAttribute('dropdown', true)->setExtra('translation_domain', 'blog');
#$menu['authors']->addChild('all_authors',['route' => 'authorquote_index'])->setExtra('translation_domain', 'blog');
/*foreach ($authors as $author){
$menu['authors']->addChild($author->getName(), array(
'route' => 'authorquote_show',
'routeParameters' => array('id' => $author->getId())
));
}*/
//$menu->addChild('Цитаты', array('route' => 'authorquote_quote_index'));
#$menu->addChild('quotes')->setAttribute('icon', 'fa fa-list')->setAttribute('dropdown', true)->setExtra('translation_domain', 'blog');
#$menu['quotes']->addChild('all_quotes', array('route' => 'authorquote_quote_index'))->setExtra('translation_domain', 'blog');
#$menu['quotes']->addChild('create_new_quote', array('route' => 'authorquote_quote_new'))->setExtra('translation_domain', 'blog');
// create another menu item
//$menu->addChild('About Me', array('route' => 'about'));
// you can also add sub level's to your menu's as follows
//$menu['About Me']->addChild('Edit profile', array('route' => 'edit_profile'));
// ... add more children
return $menu;
}
开发者ID:belikoff,项目名称:learn,代码行数:34,代码来源:Builder.php
示例17: mainMenu
public function mainMenu(FactoryInterface $factory, array $options)
{
$menu = $factory->createItem('root');
$menu->addChild('Home', array('route' => 'homepage'));
$menu->addChild('Lucky', array('route' => 'lucky', 'routeParameters' => array('count' => 2)));
$menu->addChild('Category', array('route' => 'category_index'));
$menu->addChild('Product', array('route' => 'product_index'));
$menu->addChild('Form', array('route' => 'form'));
$menu['Form']->addChild('Form1', array('route' => 'form1'));
$menu['Form']->addChild('Form2', array('route' => 'form2'));
$menu->addChild('Test', array('route' => 'test'));
$menu['Test']->addChild('Test1', array('route' => 'test1'));
$menu['Test']->addChild('Test2', array('route' => 'test2'));
$menu['Test']->addChild('Test3', array('route' => 'test3'));
$menu['Test']->addChild('Test4', array('route' => 'test4'));
$menu['Test']->addChild('Test5', array('route' => 'test5'));
$menu['Test']->addChild('Test6', array('route' => 'test6'));
// access services from the container!
// $em = $this->container->get('doctrine')->getManager();
// findMostRecent and Blog are just imaginary examples
// $blog = $em->getRepository('AppBundle:Blog')->findMostRecent();
// $menu->addChild('Latest Blog Post', array(
// 'route' => 'blog_show',
// 'routeParameters' => array('id' => $blog->getId())
// ));
// create another menu item
$menu->addChild('About Me', array('route' => 'product_index'));
// you can also add sub level's to your menu's as follows
$menu['About Me']->addChild('Edit profile', array('route' => 'lucky'));
// ... add more children
return $menu;
}
开发者ID:athos99,项目名称:symfony,代码行数:32,代码来源:Builder.php
示例18: mainMenu
public function mainMenu(FactoryInterface $factory, array $options)
{
$menu = $factory->createItem('root');
$menu->setAttribute('class', 'nav navbar-nav');
// Add translations in src/Pumukit/NewAdminBundle/Resource/translations/NewAdminBundle.locale.yml
$menu->addChild('Dashboard', array('route' => 'pumukit_newadmin_dashboard_index'))->setExtra('translation_domain', 'NewAdminBundle');
$series = $menu->addChild('Multimedia Series', array('route' => 'pumukitnewadmin_series_index'))->setExtra('translation_domain', 'NewAdminBundle');
$series->addChild('Multimedia', array('route' => 'pumukitnewadmin_mms_index'))->setExtra('translation_domain', 'NewAdminBundle');
$series->setDisplayChildren(false);
$live = $menu->addChild('Live')->setExtra('translation_domain', 'NewAdminBundle');
$live->addChild('Live Channels', array('route' => 'pumukitnewadmin_live_index'))->setExtra('translation_domain', 'NewAdminBundle');
$live->addChild('Live Events', array('route' => 'pumukitnewadmin_event_index'))->setExtra('translation_domain', 'NewAdminBundle');
$menu->addChild('Encoder jobs', array('route' => 'pumukit_encoder_info'))->setExtra('translation_domain', 'NewAdminBundle');
$tables = $menu->addChild('Tables')->setExtra('translation_domain', 'NewAdminBundle');
$tables->addChild('People', array('route' => 'pumukitnewadmin_person_index'))->setExtra('translation_domain', 'NewAdminBundle');
$tables->addChild('Tags', array('route' => 'pumukitnewadmin_tag_index'))->setExtra('translation_domain', 'NewAdminBundle');
$tables->addChild('Access profiles', array('route' => 'pumukitnewadmin_broadcast_index'))->setExtra('translation_domain', 'NewAdminBundle');
$tables->addChild('Series types', array('route' => 'pumukitnewadmin_seriestype_index'))->setExtra('translation_domain', 'NewAdminBundle');
if ($this->container->get('security.authorization_checker')->isGranted('ROLE_SUPER_ADMIN')) {
$management = $menu->addChild('Management')->setExtra('translation_domain', 'NewAdminBundle');
$management->addChild('Admin users', array('route' => 'pumukitnewadmin_user_index'))->setExtra('translation_domain', 'NewAdminBundle');
$management->addChild('Roles', array('route' => 'pumukitnewadmin_role_index'))->setExtra('translation_domain', 'NewAdminBundle');
}
if ($this->container->has("pumukit_opencast.client")) {
$ingester = $menu->addChild('Ingester')->setExtra('translation_domain', 'NewAdminBundle');
$ingester->addChild('Opencast Ingester', array('route' => 'pumukitopencast'))->setExtra('translation_domain', 'NewAdminBundle');
}
return $menu;
}
开发者ID:bmartinezteltek,项目名称:PuMuKIT2,代码行数:29,代码来源:Builder.php
示例19: mainMenu
public function mainMenu(FactoryInterface $factory, array $options)
{
$menu = $factory->createItem('root');
$menu->addChild('Liste des livres', array('route' => 'book_list'));
$menu->addChild('Ajouter un livre', array('route' => 'book_new'));
return $menu;
}
开发者ID:erdnaxe,项目名称:bibliotheque,代码行数:7,代码来源:Builder.php
示例20: mainMenu
/**
* Creates the header menu
*
* @param FactoryInterface $factory
* @param array $options
*
* @return \Knp\Menu\ItemInterface
*/
public function mainMenu(FactoryInterface $factory, array $options)
{
$isFooter = array_key_exists('is_footer', $options) ? $options['is_footer'] : false;
$shopCategories = $this->container->get('sonata.classification.manager.category')->getRootCategory('product_catalog');
$menuOptions = array_merge($options, array('childrenAttributes' => array('class' => 'nav nav-pills')));
$menu = $factory->createItem('main', $menuOptions);
$shopMenuParams = array('route' => 'sonata_catalog_index');
if (count($shopCategories->hasChildren()) > 0 && !$isFooter) {
$shopMenuParams = array_merge($shopMenuParams, array('attributes' => array('class' => 'dropdown'), 'childrenAttributes' => array('class' => 'dropdown-menu'), 'linkAttributes' => array('class' => 'dropdown-toggle', 'data-toggle' => 'dropdown', 'data-target' => '#'), 'label' => 'Products <b class="caret caret-menu"></b>', 'extras' => array('safe_label' => true)));
}
if ($isFooter) {
$shopMenuParams = array_merge($shopMenuParams, array('attributes' => array('class' => 'span2'), "childrenAttributes" => array('class' => 'nav')));
}
$shop = $menu->addChild('Shop', $shopMenuParams);
$menu->addChild('News', array('route' => 'sonata_news_home'));
foreach ($shopCategories->getChildren() as $category) {
$shop->addChild($category->getName(), array('route' => 'sonata_catalog_category', 'routeParameters' => array('category_id' => $category->getId(), 'category_slug' => $category->getSlug())));
}
$dropdownExtrasOptions = $isFooter ? array('uri' => "#", 'attributes' => array('class' => 'span2'), 'childrenAttributes' => array('class' => 'nav')) : array('uri' => "#", 'attributes' => array('class' => 'dropdown'), 'childrenAttributes' => array('class' => 'dropdown-menu'), 'linkAttributes' => array('class' => 'dropdown-toggle', 'data-toggle' => 'dropdown', 'data-target' => '#'), 'label' => 'Solutions <b class="caret caret-menu"></b>', 'extras' => array('safe_label' => true));
$extras = $factory->createItem('Discover', $dropdownExtrasOptions);
$extras->addChild('Bundles', array('route' => 'page_slug', 'routeParameters' => array('path' => '/bundles')));
$extras->addChild('Api', array('route' => 'page_slug', 'routeParameters' => array('path' => '/api-landing')));
$extras->addChild('Gallery', array('route' => 'sonata_media_gallery_index'));
$extras->addChild('Media & SEO', array('route' => 'sonata_demo_media'));
$menu->addChild($extras);
$menu->addChild('Admin', array('route' => 'page_slug', 'routeParameters' => array('path' => '/user')));
if ($isFooter) {
$menu->addChild('Legal notes', array('route' => 'page_slug', 'routeParameters' => array('path' => '/legal-notes')));
}
return $menu;
}
开发者ID:plusteams,项目名称:xxxx,代码行数:39,代码来源:Builder.php
注:本文中的Knp\Menu\FactoryInterface类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论