310. Class

310.1. Zend\Mvc\Controller\AbstractController

Abstract controller

Convenience methods for pre-built plugins (@see __call):

310.1.1. Methods

310.1.1.1. onDispatch

onDispatch()

Execute the request

Parameters:MvcEvent
Return type:mixed

310.1.1.2. dispatch

dispatch()

Dispatch a request

Parameters:
  • Request
  • null|Response
Return type:

Response|mixed

310.1.1.3. getRequest

getRequest()

Get request object

Return type:Request

310.1.1.4. getResponse

getResponse()

Get response object

Return type:Response

310.1.1.5. setEventManager

setEventManager()

Set the event manager instance used by this context

Parameters:EventManagerInterface
Return type:AbstractController

310.1.1.6. getEventManager

getEventManager()

Retrieve the event manager

Lazy-loads an EventManager instance if none registered.

Return type:EventManagerInterface

310.1.1.7. setEvent

setEvent()

Set an event to use during dispatch

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

Parameters:Event
Return type:void

310.1.1.8. getEvent

getEvent()

Get the attached event

Will create a new MvcEvent if none provided.

Return type:MvcEvent

310.1.1.9. setServiceLocator

setServiceLocator()

Set serviceManager instance

Parameters:ServiceLocatorInterface
Return type:void

310.1.1.10. getServiceLocator

getServiceLocator()

Retrieve serviceManager instance

Return type:ServiceLocatorInterface

310.1.1.11. getPluginManager

getPluginManager()

Get plugin manager

Return type:PluginManager

310.1.1.12. setPluginManager

setPluginManager()

Set plugin manager

Parameters:PluginManager
Return type:AbstractController

310.1.1.13. plugin

plugin()

Get plugin instance

Parameters:
  • string – Name of plugin to return
  • null|array – Options to pass to plugin constructor (if not already instantiated)
Return type:

mixed

310.1.1.14. __call

__call()

Method overloading: return/call plugins

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

Parameters:
  • string
  • array
Return type:

mixed

310.1.1.15. attachDefaultListeners

attachDefaultListeners()

Register the default events for this controller

Return type:void

310.1.1.16. getMethodFromAction

getMethodFromAction()

Transform an “action” token into a method name

Parameters:string
Return type:string