MenuProvider
in package
implements
MenuProviderInterface
Table of Contents
Interfaces
- MenuProviderInterface
Properties
- $builders : mixed
- $container : mixed
- $kernel : mixed
- $menuFactory : mixed
- $requestStack : mixed
Methods
- __construct() : mixed
- get() : ItemInterface
- Looks for a menu with the bundle:class:method format
- has() : bool
- Verifies if the given name follows the bundle:class:method alias syntax.
- hasAccess() : mixed
- hasAccessToSaleShow() : mixed
- getBuilder() : object
- Creates and returns the builder that lives in the given bundle
Properties
$builders
private
mixed
$builders
= []
$container
private
mixed
$container
$kernel
private
mixed
$kernel
$menuFactory
private
mixed
$menuFactory
$requestStack
private
mixed
$requestStack
Methods
__construct()
public
__construct(FactoryInterface $menuFactory, KernelInterface $kernel, ContainerInterface $container, RequestStack $requestStack) : mixed
Parameters
- $menuFactory : FactoryInterface
- $kernel : KernelInterface
- $container : ContainerInterface
- $requestStack : RequestStack
get()
Looks for a menu with the bundle:class:method format
public
get(string $name[, array<string|int, mixed> $options = [] ]) : ItemInterface
For example, AcmeBundle:Builder:mainMenu would create and instantiate an Acme\DemoBundle\Menu\Builder class and call the mainMenu() method on it. The method is passed the menu factory.
Parameters
- $name : string
-
The alias name of the menu
- $options : array<string|int, mixed> = []
Tags
Return values
ItemInterfacehas()
Verifies if the given name follows the bundle:class:method alias syntax.
public
has(string $name[, array<string|int, mixed> $options = [] ]) : bool
Parameters
- $name : string
-
The alias name of the menu
- $options : array<string|int, mixed> = []
Return values
boolhasAccess()
public
hasAccess(mixed $name[, mixed $returnType = 'header' ]) : mixed
Parameters
- $name : mixed
- $returnType : mixed = 'header'
hasAccessToSaleShow()
public
hasAccessToSaleShow(mixed $name) : mixed
Parameters
- $name : mixed
getBuilder()
Creates and returns the builder that lives in the given bundle
protected
getBuilder(string $bundleName, string $className) : object
The convention is to look in the Menu namespace of the bundle for this class, to instantiate it with no arguments, and to inject the container if the class is ContainerAware.
Parameters
- $bundleName : string
- $className : string
-
The class name of the builder