2017 © Pedro Peláez
 

library static-menu-bundle

Static menu bundle

image

sokil/static-menu-bundle

Static menu bundle

  • Sunday, September 18, 2016
  • by sokil
  • Repository
  • 1 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

StaticMenuBundle

Configure menus in symfony configuration file. This is wrapper over knp-menu-bundle., (*1)

Installation

You can install bundle through Composer:, (*2)

composer require sokil/static-menu-bundle

Add bundle to AppKernel:, (*3)

<?php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // required dependencies
            new Knp\Bundle\MenuBundle\KnpMenuBundle(),
            // menu bundle
            new Sokil\StaticMenuBundle\StaticMenuBundle(),
        );
    }
}

Configure menu in app/config/config.yml, (*4)

static_menu:
  someMenuName: # set some name to your menu
    childrenAttributes:
      class: nav navbar-nav
    items: # configure items of menu
      - label: menu_tasks
        role: ROLE_TASK_VIEWER # role allowed to see menu
        uri: /#tasks
      - label: menu_contacts
        route: contact_us_index
      - label: menu_new_task
        uri: /#tasks/new
        role: IS_AUTHENTICATED_REMEMBERED
        linkAttributes:
          class: visible-xs

See item options at vendor/knplabs/knp-menu/src/Knp/Menu/Factory/CoreExtension.php., (*5)

KNP menus rendered by calling {{ knp_menu_render('static_menu.someMenuName') }}, (*6)

The Versions

18/09 2016

dev-master

9999999-dev

Static menu bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmytro Sokil

04/08 2016

0.1.0

0.1.0.0

Static menu bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmytro Sokil