Download the PHP package wemakecustom/menu-part-bundle without Composer

On this page you can find all versions of the php package wemakecustom/menu-part-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-part-bundle

WMCMenuPartBundle

Wrapper around knplabs/knp-menu-bundle to easily create partial self contained menu providers.

The goal is to create global menus (main, top, sidebar, etc.) and have different services fill them when they see fit. An example would be a sidebar that offers actions (edit, delete, etc.) on the current resource.

This bundle really needs tests though…

WARNING: This bundles requries KnpMenuBundle ~2.0.

Installation

Download and install the bundle via composer

Enable the Bundle (and its dependencies) in the Kernel:

Creating your first menu

Using JMSDiExtraBundle, you can simply create a class that extends MenuPartInterface:

Notice the menu attribute set to user, this is mandatory. You can create multiple MenuPartInterface with the same menu name and they will concatenante themselves. You can also use the priority tag attribute to modify the order.

This is a service, so inject whatever you need: request_stack, security.authorization_checker, etc.

If you are not using JMSDiExtraBundle, you can of course use the traditional way. See menu.yml

Integration in template

Simply knp_menu_render in your template with the name of your menu.

Configuration

Out of the box, the bundle does not require any configuration.

When you create MenuPartInterface, a menu will automatically be created with default options. You can however specify additional options in the general bundle configuration:

Provided Visitors

Security filter

This filter (service name: wmc.menu_part.filter.security) will hide items the current user isn't allowed to access.

The current version of this filter relies only on the firewall and doesn't check the @Security annotations. (TODO)

Localization (L10n) visitor

You first need to enable the visitor for the menus you want to translate.

The following example enable the visitor for all menus:

This visitor will call the translator service on every menu item. The visitor can be disabled for choosen items by setting the translation_parameters extra to false.

To specify a custom translation domain, you can use the translation_domain extra.

If transChoice is to be used, specify the translation_number extra.

The item's label will be used as translation key.

Example:

Provided Voters

Voters are used to detect the current item(s) in the menu.

See voters.yml on how to use RequestVoter and PrefixVoter. The file can also be imported as-is in app/config/config.yml.

Author


All versions of menu-part-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
symfony/framework-bundle Version ^2.1|^3.0
knplabs/knp-menu-bundle Version ~2.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 wemakecustom/menu-part-bundle contains the following files

Loading the files please wait ....