Basic action controller

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

package Default
inherited_from \Zend\Mvc\Controller\AbstractController

 Methods

Method overloading: return/call plugins

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

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, null|\Zend\Stdlib\ResponseInterface $response = null) : \Zend\Stdlib\ResponseInterface | mixed
Inherited
events dispatch.pre, dispatch.post
inherited_from \Zend\Stdlib\DispatchableInterface::dispatch()

Parameters

$request

\Zend\Stdlib\RequestInterface

$response

null\Zend\Stdlib\ResponseInterface

Returns

\Zend\Stdlib\ResponseInterfacemixed

Get the attached event

getEvent() : \Zend\Mvc\MvcEvent
Inherited

Will create a new MvcEvent if none provided.

inherited_from \Zend\Mvc\InjectApplicationEventInterface::getEvent()

Returns

\Zend\Mvc\MvcEvent

Retrieve the event manager

getEventManager() : \Zend\EventManager\EventManagerInterface
Inherited

Lazy-loads an EventManager instance if none registered.

Returns

\Zend\EventManager\EventManagerInterface

Transform an "action" token into a method name

getMethodFromAction(string $action) : string
InheritedStatic

Parameters

$action

string

Returns

string

Get plugin manager

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

Returns

\Zend\Mvc\Controller\PluginManager

Get request object

getRequest() : \Zend\Stdlib\RequestInterface
Inherited

Returns

\Zend\Stdlib\RequestInterface

Get response object

getResponse() : \Zend\Stdlib\ResponseInterface
Inherited

Returns

\Zend\Stdlib\ResponseInterface

Retrieve serviceManager instance

getServiceLocator() : \Zend\ServiceManager\ServiceLocatorInterface
Inherited
inherited_from \Zend\ServiceManager\ServiceLocatorAwareInterface::getServiceLocator()

Returns

\Zend\ServiceManager\ServiceLocatorInterface

Default action if none provided

indexAction() : array

Returns

array

Action called if matched action does not exist

notFoundAction() : array

Returns

array

Execute the request

onDispatch(\Zend\Mvc\MvcEvent $e) : mixed
inherited_from \Zend\Mvc\Controller\AbstractController::onDispatch()

Parameters

$e

\Zend\Mvc\MvcEvent

Exceptions

\Zend\Mvc\Exception\DomainException

Returns

mixed

Execute the request

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

Parameters

$e

\Zend\Mvc\MvcEvent

Returns

mixed

Get plugin instance

plugin(string $name, null|array $options = null) : mixed
Inherited

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
Inherited

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

inherited_from \Zend\Mvc\InjectApplicationEventInterface::setEvent()

Parameters

$e

\Zend\EventManager\EventInterface

Set the event manager instance used by this context

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

Parameters

$events

\Zend\EventManager\EventManagerInterface

Returns

\Zend\Mvc\Controller\AbstractController

Set plugin manager

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

Parameters

$plugins

\Zend\Mvc\Controller\PluginManager

Returns

\Zend\Mvc\Controller\AbstractController

Set serviceManager instance

setServiceLocator(\Zend\ServiceManager\ServiceLocatorInterface $serviceLocator) : void
Inherited
inherited_from \Zend\ServiceManager\ServiceLocatorAwareInterface::setServiceLocator()

Parameters

$serviceLocator

\Zend\ServiceManager\ServiceLocatorInterface

Register the default events for this controller

attachDefaultListeners() : void
Inherited

createConsoleNotFoundModel()

createConsoleNotFoundModel($response) 
deprecated please use the {@see \Zend\Mvc\Controller\Plugin\CreateConsoleNotFoundModel} plugin instead: this method will be removed in release 2.5 or later. {@inheritDoc}

Parameters

$response

createHttpNotFoundModel()

createHttpNotFoundModel(\Zend\Http\Response $response) 
deprecated please use the {@see \Zend\Mvc\Controller\Plugin\CreateHttpNotFoundModel} plugin instead: this method will be removed in release 2.5 or later. {@inheritDoc}

Parameters

$response

 Properties

 

$event

$event : \Zend\EventManager\EventInterface

Default

 

$eventIdentifier

$eventIdentifier 

Default

__CLASS__
inherited_from \Zend\Mvc\Controller\AbstractController::eventIdentifier
 

$eventIdentifier

$eventIdentifier : null | string | array<mixed,string>

Default

 

$events

$events : \Zend\EventManager\EventManagerInterface

Default

 

$plugins

$plugins : \Zend\Mvc\Controller\PluginManager

Default

 

$request

$request : \Zend\Stdlib\RequestInterface

Default

 

$response

$response : \Zend\Stdlib\ResponseInterface

Default

 

$serviceLocator

$serviceLocator : \Zend\ServiceManager\ServiceLocatorInterface

Default