Download the PHP package rollerworks/navigation-bundle without Composer
On this page you can find all versions of the php package rollerworks/navigation-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rollerworks/navigation-bundle
More information about rollerworks/navigation-bundle
Files in rollerworks/navigation-bundle
Package navigation-bundle
Short Description Symfony bundle for defining menu-structures and breadcrumbs in the KnpMenuBundle
License MIT
Informations about the package navigation-bundle
RollerworksNavigationBundle
:warning: ✋ This bundle is discontinued and will be archived soon! :warning:
The RollerworksNavigationBundle adds the ability to define menu-structures and breadcrumbs for the KnpMenuBundle in your application configuration.
Requirements
You need at least PHP 5.3 and the KnpMenuBundle already installed and configured.
Installation
Note: The RollerworksNavigationBundle is an addition to the KnpMenuBundle, make sure you have the KnpMenuBundle installed and properly configured.
The recommended way to install the RollerworksNavigationBundle is through Composer.
Require the rollerworks/navigation-bundle
package by running:
Now, Composer will automatically download all the required files, and install them for you. After this enable the bundle in the kernel:
Usage
Expressions
Since Symfony 2.4 you can make some parts of your application configuration more dynamic by using the Symfony ExpressionLanguage. As the RollerworksNavigationBundle registers navigation definitions as Services in the DependencyInjection Container you can also use expressions for the "parameters" config parameter.
In practice you can use expressions for navigation translation/route and service parameters.
Parameters values starting with an @
will be treated as expressions, to mark the value
as "literal" use a double @
like '@@your value'
, which is converted to '@your value'
.
Note: Only the first leading @@
is converted a single @
, other @
's will
be left unchanged. A value like 'my@value' is not transformed to an expression.
Using a dedicated service for menu items/breadcrumbs
If your navigation is to dynamic you may also use a dedicated service.
The service must return a Knp\Menu\ItemInterface
instance.
Defining menus
Menus are defined under the rollerworks_navigation.menus
configuration tree,
you can add as many menus as you need.
Each menu is registered in the Service Container as rollerworks_navigation.menu.[menu-name]
and is tagged for the KnpMenu loader by the 'menu-name'.
Note: You can only either use a static, service or expression per menu item.
When using a service or expression sub-items must provided by the returned MenuItem object.
Defining breadcrumbs
Breadcrumbs are defined under the rollerworks_navigation.breadcrumbs
configuration tree,
you define as many breadcrumbs as you need.
Other then menus, deeper breadcrumbs reference there parent by name, the parent may in turn reference another parent.
Tip:
It's a good practice to keep the related breadcrumb(s) in there own bundle, and use a 'root-bundle' to reference from.
Use the importing capabilities of the Symfony Config component for importing config files from other bundles.
The final structure is normalized before registering, so no complex building or resolving is done that runtime.
Each breadcrumb is registered in the Service Container as rollerworks_navigation.breadcrumbs.[breadcrumb-name]
and is tagged for the KnpMenu loader by the 'breadcrumb-name'.
Caution:
Each breadcrumb name must be unique thought-out the application. It's advised to use the same conventions as used for service-id's.
For example 'homepage' could be named 'acme_breadcrumbs.homepage'.
Versioning
For transparency and insight into the release cycle, and for striving to maintain backward compatibility, RollerworksSearch is maintained under the Semantic Versioning guidelines as much as possible.
Releases will be numbered with the following format:
<major>.<minor>.<patch>
And constructed with the following guidelines:
- Breaking backward compatibility bumps the major (and resets the minor and patch)
- New additions without breaking backward compatibility bumps the minor (and resets the patch)
- Bug fixes and misc changes bumps the patch
For more information on SemVer, please visit http://semver.org/.
License
The source of this package is subject to the MIT license that is bundled with this source code in the file LICENSE.
Contributing
This is an open source project. If you'd like to contribute, please read the Contributing Guidelines. If you're submitting a pull request, please follow the guidelines in the Submitting a Patch section.
All versions of navigation-bundle with dependencies
symfony/framework-bundle Version ~2.3|~3.0
symfony/dependency-injection Version ~2.4|~3.0
symfony/expression-language Version ~2.4|~3.0
knplabs/knp-menu-bundle Version ^2.0.0