PHP Class Zend\Mvc\Controller\AbstractController

Inheritance: implements Zend\Stdlib\DispatchableInterface, implements Zend\EventManager\EventManagerAwareInterface, implements Zend\Mvc\InjectApplicationEventInterface, implements Zend\ServiceManager\ServiceLocatorAwareInterface
Datei anzeigen Open project: zendframework/zend-mvc Class Usage Examples

Protected Properties

Property Type Description
$event Zend\EventManager\EventInterface
$eventIdentifier null | string | string[]
$events Zend\EventManager\EventManagerInterface
$plugins PluginManager
$request Zend\Stdlib\RequestInterface
$response Zend\Stdlib\ResponseInterface

Public Methods

Method Description
__call ( string $method, array $params ) : mixed Method overloading: return/call plugins
dispatch ( Zend\Stdlib\RequestInterface $request, Zend\Stdlib\ResponseInterface $response = null ) : Zend\Stdlib\ResponseInterface | mixed Dispatch a request
getEvent ( ) : MvcEvent Get the attached event
getEventManager ( ) : Zend\EventManager\EventManagerInterface Retrieve the event manager
getMethodFromAction ( string $action ) : string Transform an "action" token into a method name
getPluginManager ( ) : PluginManager Get plugin manager
getRequest ( ) : Zend\Stdlib\RequestInterface Get request object
getResponse ( ) : Zend\Stdlib\ResponseInterface Get response object
onDispatch ( MvcEvent $e ) : mixed Execute the request
plugin ( string $name, array $options = null ) : mixed Get plugin instance
setEvent ( Zend\EventManager\EventInterface $e ) : void Set an event to use during dispatch
setEventManager ( Zend\EventManager\EventManagerInterface $events ) : AbstractController Set the event manager instance used by this context
setPluginManager ( PluginManager $plugins ) : AbstractController Set plugin manager

Protected Methods

Method Description
attachDefaultListeners ( ) : void Register the default events for this controller

Method Details

__call() public method

If the plugin is a functor, call it, passing the parameters provided. Otherwise, return the plugin instance.
public __call ( string $method, array $params ) : mixed
$method string
$params array
return mixed

attachDefaultListeners() protected method

Register the default events for this controller
protected attachDefaultListeners ( ) : void
return void

dispatch() public method

Dispatch a request
public dispatch ( Zend\Stdlib\RequestInterface $request, Zend\Stdlib\ResponseInterface $response = null ) : Zend\Stdlib\ResponseInterface | mixed
$request Zend\Stdlib\RequestInterface
$response Zend\Stdlib\ResponseInterface
return Zend\Stdlib\ResponseInterface | mixed

getEvent() public method

Will create a new MvcEvent if none provided.
public getEvent ( ) : MvcEvent
return Zend\Mvc\MvcEvent

getEventManager() public method

Lazy-loads an EventManager instance if none registered.
public getEventManager ( ) : Zend\EventManager\EventManagerInterface
return Zend\EventManager\EventManagerInterface

getMethodFromAction() public static method

Transform an "action" token into a method name
public static getMethodFromAction ( string $action ) : string
$action string
return string

getPluginManager() public method

Get plugin manager
public getPluginManager ( ) : PluginManager
return PluginManager

getRequest() public method

Get request object
public getRequest ( ) : Zend\Stdlib\RequestInterface
return Zend\Stdlib\RequestInterface

getResponse() public method

Get response object
public getResponse ( ) : Zend\Stdlib\ResponseInterface
return Zend\Stdlib\ResponseInterface

onDispatch() abstract public method

Execute the request
abstract public onDispatch ( MvcEvent $e ) : mixed
$e Zend\Mvc\MvcEvent
return mixed

plugin() public method

Get plugin instance
public plugin ( string $name, array $options = null ) : mixed
$name string Name of plugin to return
$options array Options to pass to plugin constructor (if not already instantiated)
return mixed

setEvent() public method

By default, will re-cast to MvcEvent if another event type is provided.
public setEvent ( Zend\EventManager\EventInterface $e ) : void
$e Zend\EventManager\EventInterface
return void

setEventManager() public method

Set the event manager instance used by this context
public setEventManager ( Zend\EventManager\EventManagerInterface $events ) : AbstractController
$events Zend\EventManager\EventManagerInterface
return AbstractController

setPluginManager() public method

Set plugin manager
public setPluginManager ( PluginManager $plugins ) : AbstractController
$plugins PluginManager
return AbstractController

Property Details

$event protected_oe property

protected EventInterface,Zend\EventManager $event
return Zend\EventManager\EventInterface

$eventIdentifier protected_oe property

protected null|string|string[] $eventIdentifier
return null | string | string[]

$events protected_oe property

protected EventManagerInterface,Zend\EventManager $events
return Zend\EventManager\EventManagerInterface

$plugins protected_oe property

protected PluginManager,Zend\Mvc\Controller $plugins
return PluginManager

$request protected_oe property

protected RequestInterface,Zend\Stdlib $request
return Zend\Stdlib\RequestInterface

$response protected_oe property

protected ResponseInterface,Zend\Stdlib $response
return Zend\Stdlib\ResponseInterface