Basic action controller

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

 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.

inherited_from \Zend\Mvc\Controller\AbstractController::__call()
inherited_from \Zend\Mvc\Controller\AbstractActionController::__call()

Parameters

$method

string

$params

array

Returns

mixed

Dispatch a request

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

Get the attached event

getEvent() : \Zend\Mvc\MvcEvent
Inherited

Will create a new MvcEvent if none provided.

inherited_from \Zend\Mvc\Controller\AbstractController::getEvent()
inherited_from \Zend\Mvc\Controller\AbstractActionController::getEvent()

Returns

Retrieve the event manager

getEventManager() : \Zend\EventManager\EventManagerInterface
Inherited

Lazy-loads an EventManager instance if none registered.

inherited_from \Zend\Mvc\Controller\AbstractController::getEventManager()
inherited_from \Zend\Mvc\Controller\AbstractActionController::getEventManager()

Returns

Transform an "action" token into a method name

getMethodFromAction(string $action) : string
Inherited

inherited_from \Zend\Mvc\Controller\AbstractController::getMethodFromAction()
inherited_from \Zend\Mvc\Controller\AbstractActionController::getMethodFromAction()

Parameters

$action

string

Returns

string

Get plugin manager

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

inherited_from \Zend\Mvc\Controller\AbstractController::getPluginManager()
inherited_from \Zend\Mvc\Controller\AbstractActionController::getPluginManager()

Returns

Get request object

getRequest() : \Zend\Stdlib\RequestInterface
Inherited

inherited_from \Zend\Mvc\Controller\AbstractController::getRequest()
inherited_from \Zend\Mvc\Controller\AbstractActionController::getRequest()

Returns

Get response object

getResponse() : \Zend\Stdlib\ResponseInterface
Inherited

inherited_from \Zend\Mvc\Controller\AbstractController::getResponse()
inherited_from \Zend\Mvc\Controller\AbstractActionController::getResponse()

Returns

Retrieve serviceManager instance

getServiceLocator() : \Zend\ServiceManager\ServiceLocatorInterface
Inherited

inherited_from \Zend\Mvc\Controller\AbstractController::getServiceLocator()
inherited_from \Zend\Mvc\Controller\AbstractActionController::getServiceLocator()

Returns

Default action if none provided

indexAction() : array
Inherited

inherited_from \Zend\Mvc\Controller\AbstractActionController::indexAction()

Returns

array

Action called if matched action does not exist

notFoundAction() : array
Inherited

inherited_from \Zend\Mvc\Controller\AbstractActionController::notFoundAction()

Returns

array

Execute the request

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

inherited_from \Zend\Mvc\Controller\AbstractActionController::onDispatch()

Parameters

Exceptions

\Zend\Mvc\Exception\DomainException

Returns

mixed

Get plugin instance

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

inherited_from \Zend\Mvc\Controller\AbstractController::plugin()
inherited_from \Zend\Mvc\Controller\AbstractActionController::plugin()

Parameters

$name

string

Name of plugin to return

$options

nullarray

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

Returns

mixed

setConsole()

setConsole(\Zend\Console\Adapter\AdapterInterface $console) : \Zend\Mvc\Controller\self

Parameters

Returns

\Zend\Mvc\Controller\self

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\Controller\AbstractController::setEvent()
inherited_from \Zend\Mvc\Controller\AbstractActionController::setEvent()

Parameters

Set the event manager instance used by this context

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

inherited_from \Zend\Mvc\Controller\AbstractController::setEventManager()
inherited_from \Zend\Mvc\Controller\AbstractActionController::setEventManager()

Parameters

Returns

Set plugin manager

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

inherited_from \Zend\Mvc\Controller\AbstractController::setPluginManager()
inherited_from \Zend\Mvc\Controller\AbstractActionController::setPluginManager()

Parameters

Returns

Set serviceManager instance

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

inherited_from \Zend\Mvc\Controller\AbstractController::setServiceLocator()
inherited_from \Zend\Mvc\Controller\AbstractActionController::setServiceLocator()

Parameters

Register the default events for this controller

attachDefaultListeners() : void
Inherited

inherited_from \Zend\Mvc\Controller\AbstractController::attachDefaultListeners()
inherited_from \Zend\Mvc\Controller\AbstractActionController::attachDefaultListeners()

Create a console view model representing a "not found" action

createConsoleNotFoundModel(\Zend\Stdlib\ResponseInterface $response) : \Zend\View\Model\ConsoleModel
Inherited

inherited_from \Zend\Mvc\Controller\AbstractActionController::createConsoleNotFoundModel()

Parameters

Returns

Create an HTTP view model representing a "not found" page

createHttpNotFoundModel(\Zend\Http\Response $response) : \Zend\View\Model\ViewModel
Inherited

inherited_from \Zend\Mvc\Controller\AbstractActionController::createHttpNotFoundModel()

Parameters

Returns

 Properties

   

$event

$event : \Zend\EventManager\EventInterface
Inherited

inherited_from \Zend\Mvc\Controller\AbstractController::$$event
inherited_from \Zend\Mvc\Controller\AbstractActionController::$$event
 

$eventIdentifier

$eventIdentifier : string
Inherited

inherited_from \Zend\Mvc\Controller\AbstractActionController::$$eventIdentifier
 

$events

$events : \Zend\EventManager\EventManagerInterface
Inherited

inherited_from \Zend\Mvc\Controller\AbstractController::$$events
inherited_from \Zend\Mvc\Controller\AbstractActionController::$$events
 

$plugins

$plugins : \Zend\Mvc\Controller\PluginManager
Inherited

inherited_from \Zend\Mvc\Controller\AbstractController::$$plugins
inherited_from \Zend\Mvc\Controller\AbstractActionController::$$plugins
 

$request

$request : \Zend\Stdlib\RequestInterface
Inherited

inherited_from \Zend\Mvc\Controller\AbstractController::$$request
inherited_from \Zend\Mvc\Controller\AbstractActionController::$$request
 

$response

$response : \Zend\Stdlib\ResponseInterface
Inherited

inherited_from \Zend\Mvc\Controller\AbstractController::$$response
inherited_from \Zend\Mvc\Controller\AbstractActionController::$$response
 

$serviceLocator

$serviceLocator : \Zend\ServiceManager\ServiceLocatorInterface
Inherited

inherited_from \Zend\Mvc\Controller\AbstractController::$$serviceLocator
inherited_from \Zend\Mvc\Controller\AbstractActionController::$$serviceLocator