PHP Class Zend\Mvc\Controller\PluginManager

Registers a number of default plugins, and contains an initializer for injecting plugins with the current controller.
Inheritance: extends Zend\ServiceManager\AbstractPluginManager
Mostrar archivo Open project: zendframework/zend-mvc Class Usage Examples

Protected Properties

Property Type Description
$aliases Default aliases
$controller Zend\Stdlib\DispatchableInterface
$factories Default factories
$instanceOf string Plugins must be of this type.

Public Methods

Method Description
get ( string $name, array $options = null ) : Zend\Stdlib\DispatchableInterface Retrieve a registered instance
getController ( ) : null | Zend\Stdlib\DispatchableInterface Retrieve controller instance
injectController ( object $plugin ) : void Inject a helper instance with the registered controller
setController ( Zend\Stdlib\DispatchableInterface $controller ) : PluginManager Set controller
validate ( $plugin ) Validate a plugin (v3)
validatePlugin ( $plugin ) Validate a plugin (v2)

Method Details

get() public method

After the plugin is retrieved from the service locator, inject the controller in the plugin every time it is requested. This is required because a controller can use a plugin and another controller can be dispatched afterwards. If this second controller uses the same plugin as the first controller, the reference to the controller inside the plugin is lost.
public get ( string $name, array $options = null ) : Zend\Stdlib\DispatchableInterface
$name string
$options array
return Zend\Stdlib\DispatchableInterface

getController() public method

Retrieve controller instance
public getController ( ) : null | Zend\Stdlib\DispatchableInterface
return null | Zend\Stdlib\DispatchableInterface

injectController() public method

Inject a helper instance with the registered controller
public injectController ( object $plugin ) : void
$plugin object
return void

setController() public method

Set controller
public setController ( Zend\Stdlib\DispatchableInterface $controller ) : PluginManager
$controller Zend\Stdlib\DispatchableInterface
return PluginManager

validate() public method

{@inheritDoc}
public validate ( $plugin )

validatePlugin() public method

{@inheritDoc}
public validatePlugin ( $plugin )

Property Details

$aliases protected_oe property

Default aliases
protected $aliases

$controller protected_oe property

protected DispatchableInterface,Zend\Stdlib $controller
return Zend\Stdlib\DispatchableInterface

$factories protected_oe property

Default factories
protected $factories

$instanceOf protected_oe property

Plugins must be of this type.
protected string $instanceOf
return string