Download the PHP package cscfa/navbar-bundle without Composer
On this page you can find all versions of the php package cscfa/navbar-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package navbar-bundle
NavBarBundle
Version: 1.0.5-dev
The NavBarBundle allow to create a navbar from navbar.yml files placed into the Resources/config directory.
Installation
Register the bundle into app/appKernel.php
The navbar.yml file construction
The default place of the 'navbar.yml' file is into 'Resources/config' directory. It's possible to change this place by using the following configuration :
note the given path must start with '/' and contain the complete file name. (example with the default configuration : '/Resources/config/navbar.yml')
The file format is :
The 'navbar' element is the root element.
The 'name' element is the identifyer of the navbar element, it can be used for define parent and will be used as label if 'label' is not defined.
The 'label' element is used as element text for rendering. It's an optional element.
The 'roles' element is used to render or not the element, according with the current user roles. It's an optional element.
The 'parent' element is used to define the parent element of the current for the rendering logic. It's an optional element.
The 'path' and 'url' elements are used to define the navbar element destination. The 'path' element is a generated application route with 'route' as route name and 'param' as route parameters. It's an optional element.
The 'options' element is used to send options to the render template. It's an optional element.
The 'position' element is used to set the position of the element into the navbar. It order the heads elements instead of childs inside their parents. _note the default position can be set by the 'defaultposition' parameter of the configuration.
The template
Use twig function '{{ renderNavbar() }}' to display the navbar with the default template.
To use personnal template, use the app/config/config.yml with the following parameters:
The 'template' parameter define the root template of the navbar. The template receive the navbar element into the 'element' variable.
The 'child_template' parameter define the rendered template for each elements of the navbar. This template receive a child into 'element' variable and the navbar nesting level into 'nestedLevel' variable.
Use cache
By default, the navbar loader will use cache to store the builded navbar. Configure with the following in 'app/config/config.yml' :
All versions of navbar-bundle with dependencies
symfony/framework-bundle Version ~2.1
cscfa/cache-system-bundle Version dev-master