Download the PHP package wucdbm/menu-builder-bundle without Composer

On this page you can find all versions of the php package wucdbm/menu-builder-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package menu-builder-bundle

menu-builder-bundle

A simple, standalone Menu Builder for Symfony 2 Applications

Upcoming / TODO

Minor TODO

Usage

Having properly configured uglifycss and uglifyjs is a requirement for production.

Add this bundle to your AppKernel.php new \Wucdbm\Bundle\MenuBuilderBundle\WucdbmMenuBuilderBundle()

In your config.yml, add WucdbmMenuBuilderBundle to your assetic bundles, as well as your doctrine mapping (if not automatic)

Execute app/console doctrine:schema:update --dump-sql and after verifying what is being executed, execute again with --force. Alternatively, use doctrine migrations via the DoctrineMigrations bundle.

Execute app/console wucdbm_menu_builder:import_routes to import your current routes from your symfony application into the tables created by the bundle.

Alternatively, add Wucdbm\\Bundle\\MenuBuilderBundle\\Composer\\ScriptHandler::importRoutes to your composer.json's post-install-cmd or post-update-cmd command list and this will be executed after every install or update

Once this has been done, you can start using the bundle. Simply register it in your routing.yml like so:

Assuming that /admin is protected by a firewall, the builder should be secure and inaccessible to random people.

You can create a link to the builder using {{ path('wucdbm_menu_builder_dashboard') }}, or embed it into your admin UI via an iframe like so <iframe src="{{ path('wucdbm_menu_builder_dashboard') }}" style="border: 0; width: 100%; height: 100%;"></iframe>

The User Interface is pretty anemic as this bundle only implements the core functionality and the administrative (for developers) functionality. If you want to let users (non-developers) manipulate menus, check out the WucdbmMenuBuilderClientBundle() Once you have created a menu, you can access it in your application by calling the getMenu twig function, which will return Wucdbm\Bundle\MenuBuilderBundle\Entity\Menu or null. A menu contains Wucdbm\Bundle\MenuBuilderBundle\Entity\MenuItems. Menu items can be nested, ie they have a parent and children. A good idea when listing the top-level menu is to only list items whose parent is null:

Printing a link for a menu is done via the menuItemPath twig filter/function, like so:

Or for absolute links

You can also use the second (optional) parameter for menuItemUrl and set the type of address (one of the Symfony\Component\Routing\Generator\UrlGeneratorInterface constants)

Dynamic Default Parameters

If you want to have a dynamic default parameter for some of your routes, for instance, routes with a dynamic locale:

In config.yml:

In routing.yml:

Generally, you do NOT need the defaults: {_locale: %locale%} part because you already have the default locale configured in your framework bundle config, but this will only work for _locale However, with this approach the default value for the _locale route parameter will be available to the menu builder when importing routes. When building a link, you may choose to leave the field blank if there is a default parameter. This will allow you to change the default value for that parameter at a later point, WITHOUT having to update menu items. When routes are updated during the deployment of your application, the default value for that parameter of your route will also be updated. The current value of the default parameter will always be saved upon menu item edit anyway, but the menu builder will always try to use the current default value for that route parameter. If the default value for any parameter has been removed, it will fallback to the route default parameter as has been on the last menu item save.

Not to be confused with symfony internal parameters such as _locale that may have another default value in the current context

An example would be a site with default locale of "en", but the user is browsing the "fr" version. You want your links to always point to the current locale and not to a pre-selected one or the default for your site. Which is a feature that has not yet been developed, but this would allow you to completely ignore a parameter and not provide it if it already exists in the router context? To be researched. See TODOs for more information on this.


All versions of menu-builder-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ~5.5|~7.0
wucdbm/wucdbm-bundle Version ~3.1
symfony/symfony Version ~3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wucdbm/menu-builder-bundle contains the following files

Loading the files please wait ....