Zend Framework  2.4
Public Member Functions | Protected Attributes | List of all members
HelperPluginManager Class Reference

Plugin manager implementation for view helpers. More...

Public Member Functions

 __construct (ConfigInterface $configuration=null)
 Constructor.
 
 setRenderer (Renderer\RendererInterface $renderer)
 Set renderer.
 
 getRenderer ()
 Retrieve renderer instance.
 
 injectRenderer ($helper)
 Inject a helper instance with the registered renderer.
 
 injectTranslator ($helper)
 Inject a helper instance with the registered translator.
 
 validatePlugin ($plugin)
 Validate the plugin.
 
- Public Member Functions inherited from AbstractPluginManager
 __construct (ConfigInterface $configuration=null)
 Constructor.
 
 validatePlugin ($plugin)
 Validate the plugin.
 
 get ($name, $options=array(), $usePeeringServiceManagers=true)
 Retrieve a service from the manager by name.
 
 setService ($name, $service, $shared=true)
 Register a service with the locator.
 
 setServiceLocator (ServiceLocatorInterface $serviceLocator)
 Set the main service locator so factories can have access to it to pull deps.
 
 getServiceLocator ()
 Get the main plugin manager.
 
- Public Member Functions inherited from ServiceManager
 __construct (ConfigInterface $config=null)
 Constructor.
 
 setAllowOverride ($allowOverride)
 Set allow override.
 
 getAllowOverride ()
 Get allow override.
 
 setShareByDefault ($shareByDefault)
 Set flag indicating whether services are shared by default.
 
 shareByDefault ()
 Are services shared by default?
 
 setThrowExceptionInCreate ($throwExceptionInCreate)
 Set throw exceptions in create.
 
 getThrowExceptionInCreate ()
 Get throw exceptions in create.
 
 setRetrieveFromPeeringManagerFirst ($retrieveFromPeeringManagerFirst=true)
 Set flag indicating whether to pull from peering manager before attempting creation.
 
 retrieveFromPeeringManagerFirst ()
 Should we retrieve from the peering manager prior to attempting to create a service?
 
 setInvokableClass ($name, $invokableClass, $shared=null)
 Set invokable class.
 
 setFactory ($name, $factory, $shared=null)
 Set factory.
 
 addAbstractFactory ($factory, $topOfStack=true)
 Add abstract factory.
 
 addDelegator ($serviceName, $delegatorFactoryName)
 Sets the given service name as to be handled by a delegator factory.
 
 addInitializer ($initializer, $topOfStack=true)
 Add initializer.
 
 setService ($name, $service)
 Register a service with the locator.
 
 setShared ($name, $isShared)
 
 isShared ($name)
 
 get ($name, $usePeeringServiceManagers=true)
 Retrieve a registered instance.
 
 create ($name)
 Create an instance of the requested service.
 
 doCreate ($rName, $cName)
 Actually creates the service.
 
 canCreate ($name, $checkAbstractFactories=true)
 Determine if we can create an instance.
 
 has ($name, $checkAbstractFactories=true, $usePeeringServiceManagers=true)
 Determine if an instance exists.
 
 canCreateFromAbstractFactory ($cName, $rName)
 Determine if we can create an instance from an abstract factory.
 
 setAlias ($alias, $nameOrAlias)
 
 hasAlias ($alias)
 Determine if we have an alias.
 
 createScopedServiceManager ($peering=self::SCOPE_PARENT)
 Create scoped service manager.
 
 addPeeringServiceManager (ServiceManager $manager, $peering=self::SCOPE_PARENT)
 Add a peering relationship.
 
 getRegisteredServices ()
 Retrieve a keyed list of all registered services.
 
 getCanonicalNames ()
 Retrieve a keyed list of all canonical names.
 
 setCanonicalNames ($canonicalNames)
 Allows to override the canonical names lookup map with predefined values.
 
- Public Member Functions inherited from ServiceLocatorInterface
 get ($name)
 Retrieve a registered instance.
 
 has ($name)
 Check for a registered instance.
 

Protected Attributes

 $factories
 
 $invokableClasses
 
 $renderer
 
- Protected Attributes inherited from AbstractPluginManager
 $allowOverride = true
 
 $autoAddInvokableClass = true
 
 $creationOptions = null
 
 $serviceLocator
 
- Protected Attributes inherited from ServiceManager
 $canonicalNames = array()
 
 $allowOverride = false
 
 $invokableClasses = array()
 
 $factories = array()
 
 $abstractFactories = array()
 
 $delegators = array()
 
 $pendingAbstractFactoryRequests = array()
 
 $nestedContextCounter = -1
 
 $nestedContext = array()
 
 $shared = array()
 
 $instances = array()
 
 $aliases = array()
 
 $initializers = array()
 
 $peeringServiceManagers = array()
 
 $shareByDefault = true
 
 $retrieveFromPeeringManagerFirst = false
 
 $throwExceptionInCreate = true
 
 $canonicalNamesReplacements = array('-' => '', '_' => '', ' ' => '', '\\' => '', '/' => '')
 
 $serviceManagerCaller
 

Additional Inherited Members

- Public Attributes inherited from ServiceManager
const SCOPE_PARENT = 'parent'
 #+ Constants
 
const SCOPE_CHILD = 'child'
 
- Protected Member Functions inherited from AbstractPluginManager
 createFromInvokable ($canonicalName, $requestedName)
 Attempt to create an instance via an invokable class.
 
 createFromFactory ($canonicalName, $requestedName)
 Attempt to create an instance via a factory class.
 
 createServiceViaCallback ($callable, $cName, $rName)
 Create service via callback.
 
- Static Protected Member Functions inherited from ServiceManager
static isSubclassOf ($className, $type)
 Checks if the object has this class as one of its parents.
 

Detailed Description

Plugin manager implementation for view helpers.

Enforces that helpers retrieved are instances of Helper. Additionally, it registers a number of default helpers.

Constructor & Destructor Documentation

__construct ( ConfigInterface  $configuration = null)

Constructor.

After invoking parent constructor, add an initializer to inject the attached renderer and translator, if any, to the currently requested helper.

Parameters
null | ConfigInterface$configuration

Member Function Documentation

getRenderer ( )

Retrieve renderer instance.

Returns
null|Renderer
injectRenderer (   $helper)

Inject a helper instance with the registered renderer.

Parameters
Helper\HelperInterface$helper
Returns
void
injectTranslator (   $helper)

Inject a helper instance with the registered translator.

Parameters
Helper\HelperInterface$helper
Returns
void
setRenderer ( Renderer\RendererInterface  $renderer)

Set renderer.

Parameters
Renderer\RendererInterface$renderer
Returns
HelperPluginManager
validatePlugin (   $plugin)

Validate the plugin.

Checks that the helper loaded is an instance of Helper.

Parameters
mixed$plugin
Returns
void
Exceptions
Exception\InvalidHelperExceptionif invalid

Member Data Documentation

$factories
protected
Initial value:
= array(
'flashmessenger' => 'Zend\View\Helper\Service\FlashMessengerFactory',
'identity' => 'Zend\View\Helper\Service\IdentityFactory',
)
$invokableClasses
protected
$renderer
protected