Abstract RESTful controller

category Zend
package Zend_Mvc
subpackage Controller

 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()

Parameters

$method

string

$params

array

Returns

mixed

Create a new resource

create(mixed $data) : mixed

Parameters

$data

mixed

Returns

mixed

Delete an existing resource

delete(mixed $id) : mixed

Parameters

$id

mixed

Returns

mixed

Dispatch a request

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

If the route match includes an "action" key, then this acts basically like a standard action controller. Otherwise, it introspects the HTTP method to determine how to handle the request, and which method to delegate to.

events dispatch.pre, dispatch.post

Parameters

Exceptions

\Zend\Mvc\Exception\InvalidArgumentException

Returns

Return single resource

get(mixed $id) : mixed

Parameters

$id

mixed

Returns

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()

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()

Returns

Return list of resources

getList() : mixed

Returns

mixed

Transform an "action" token into a method name

getMethodFromAction(string $action) : string
Inherited

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

Parameters

$action

string

Returns

string

Get plugin manager

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

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

Returns

Get request object

getRequest() : \Zend\Stdlib\RequestInterface
Inherited

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

Returns

Get response object

getResponse() : \Zend\Stdlib\ResponseInterface
Inherited

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

Returns

Retrieve serviceManager instance

getServiceLocator() : \Zend\ServiceManager\ServiceLocatorInterface
Inherited

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

Returns

Basic functionality for when a page is not available

notFoundAction() : array

Returns

array

Handle the request

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

Parameters

Exceptions

\Zend\Mvc\Exception\DomainException if no route matches in event or invalid HTTP method

Returns

mixed

Get plugin instance

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

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

Parameters

$name

string

Name of plugin to return

$options

nullarray

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

Returns

mixed

Process post data and call create

processPostData(\Zend\Stdlib\RequestInterface $request) : mixed

Parameters

Returns

mixed

Process put data and call update

processPutData(\Zend\Stdlib\RequestInterface $request, $routeMatch) : mixed

Parameters

$routeMatch

Exceptions

\Zend\Mvc\Exception\DomainException

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\Controller\AbstractController::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()

Parameters

Returns

Set plugin manager

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

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

Parameters

Returns

Set serviceManager instance

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

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

Parameters

Update an existing resource

update(mixed $id, mixed $data) : mixed

Parameters

$id

mixed

$data

mixed

Returns

mixed

Register the default events for this controller

attachDefaultListeners() : void
Inherited

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

 Properties

 

$event

$event : \Zend\EventManager\EventInterface
Inherited

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

$eventIdentifier

$eventIdentifier : string

 

$events

$events : \Zend\EventManager\EventManagerInterface
Inherited

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

$plugins

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

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

$request

$request : \Zend\Stdlib\RequestInterface
Inherited

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

$response

$response : \Zend\Stdlib\ResponseInterface
Inherited

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

$serviceLocator

$serviceLocator : \Zend\ServiceManager\ServiceLocatorInterface
Inherited

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