Abstract controller

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

package Default

 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

acceptableViewModelSelector()

acceptableViewModelSelector() : 
magic
method

Returns

createConsoleNotFoundModel()

createConsoleNotFoundModel() : 
magic
method

Returns

createHttpNotFoundModel()

createHttpNotFoundModel() : 
magic
method

Returns

Dispatch a request

dispatch(\Zend\Stdlib\RequestInterface $request, null|\Zend\Stdlib\ResponseInterface $response = null) : \Zend\Stdlib\ResponseInterface | mixed
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

filePostRedirectGet()

filePostRedirectGet() : 
magic
method

Returns

fileprg()

fileprg() : 
magic
method

Returns

flashMessenger()

flashMessenger() : 
magic
method

Returns

forward()

forward() : 
magic
method

Returns

Get the attached event

getEvent() : \Zend\Mvc\MvcEvent

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

Lazy-loads an EventManager instance if none registered.

Returns

\Zend\EventManager\EventManagerInterface

Transform an "action" token into a method name

getMethodFromAction(string $action) : string
Static

Parameters

$action

string

Returns

string

Get plugin manager

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

Returns

\Zend\Mvc\Controller\PluginManager

Get request object

getRequest() : \Zend\Stdlib\RequestInterface

Returns

\Zend\Stdlib\RequestInterface

Get response object

getResponse() : \Zend\Stdlib\ResponseInterface

Returns

\Zend\Stdlib\ResponseInterface

Retrieve serviceManager instance

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

Returns

\Zend\ServiceManager\ServiceLocatorInterface

identity()

identity() : 
magic
method

Returns

layout()

layout() : 
magic
method

Returns

Execute the request

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

Parameters

$e

\Zend\Mvc\MvcEvent

Returns

mixed

params()

params() : 
magic
method

Returns

Get plugin instance

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

Parameters

$name

string

Name of plugin to return

$options

nullarray

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

Returns

mixed

postRedirectGet()

postRedirectGet() : 
magic
method

Returns

prg()

prg() : 
magic
method

Returns

redirect()

redirect() : 
magic
method

Returns

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.

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_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

Parameters

$plugins

\Zend\Mvc\Controller\PluginManager

Returns

\Zend\Mvc\Controller\AbstractController

Set serviceManager instance

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

Parameters

$serviceLocator

\Zend\ServiceManager\ServiceLocatorInterface

url()

url() : 
magic
method

Returns

Register the default events for this controller

attachDefaultListeners() : void

 Properties

 

$event

$event : \Zend\EventManager\EventInterface

Default

 

$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