Abstract controller

category Zend
package Zend_Mvc
subpackage Controller

 Methods

Method overloading: return/call plugins

__call(string $method, array $params) : mixed

If the plugin is a functor, call it, passing the parameters provided. Otherwise, return the plugin instance.

Parameters

$method

string

$params

array

Returns

mixed

Dispatch a request

dispatch(\Zend\Stdlib\RequestInterface $request, \Zend\Stdlib\ResponseInterface $response) : \Zend\Stdlib\ResponseInterface | mixed

events dispatch.pre, dispatch.post

Parameters

Returns

Get the attached event

getEvent() : \Zend\Mvc\MvcEvent

Will create a new MvcEvent if none provided.

Returns

Retrieve the event manager

getEventManager() : \Zend\EventManager\EventManagerInterface

Lazy-loads an EventManager instance if none registered.

Returns

Transform an "action" token into a method name

getMethodFromAction(string $action) : string

Parameters

$action

string

Returns

string

Get plugin manager

getPluginManager() : \Zend\Mvc\Controller\PluginManager

Get request object

getRequest() : \Zend\Stdlib\RequestInterface

Get response object

getResponse() : \Zend\Stdlib\ResponseInterface

Retrieve serviceManager instance

getServiceLocator() : \Zend\ServiceManager\ServiceLocatorInterface

Execute the request

onDispatch(\Zend\Mvc\MvcEvent $e) : mixed

Parameters

Returns

mixed

Get plugin instance

plugin(string $name, array $options) : mixed

Parameters

$name

string

Name of plugin to return

$options

nullarray

Options to pass to plugin constructor (if not already instantiated)

Returns

mixed

Set an event to use during dispatch

setEvent(\Zend\EventManager\EventInterface $e) : void

By default, will re-cast to MvcEvent if another event type is provided.

Parameters

Set the event manager instance used by this context

setEventManager(\Zend\EventManager\EventManagerInterface $events) : \Zend\Mvc\Controller\AbstractController

Set plugin manager

setPluginManager(\Zend\Mvc\Controller\PluginManager $plugins) : \Zend\Mvc\Controller\AbstractController

Set serviceManager instance

setServiceLocator(\Zend\ServiceManager\ServiceLocatorInterface $serviceLocator) : void

Register the default events for this controller

attachDefaultListeners() : void

 Properties

   

$eventIdentifier

$eventIdentifier : string

   

$plugins

$plugins : \Zend\Mvc\Controller\PluginManager

 

$request

$request : \Zend\Stdlib\RequestInterface

 

$response

$response : \Zend\Stdlib\ResponseInterface

 

$serviceLocator

$serviceLocator : \Zend\ServiceManager\ServiceLocatorInterface