Zend Framework  3.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AbstractController Class Reference

Abstract controller. More...

Public Member Functions

 onDispatch (MvcEvent $e)
 Execute the request.
 
 dispatch (Request $request, Response $response=null)
 Dispatch a request.
 
 getRequest ()
 Get request object.
 
 getResponse ()
 Get response object.
 
 setEventManager (EventManagerInterface $events)
 Set the event manager instance used by this context.
 
 getEventManager ()
 Retrieve the event manager.
 
 setEvent (Event $e)
 Set an event to use during dispatch.
 
 getEvent ()
 Get the attached event.
 
 getPluginManager ()
 Get plugin manager.
 
 setPluginManager (PluginManager $plugins)
 Set plugin manager.
 
 plugin ($name, array $options=null)
 Get plugin instance.
 
 __call ($method, $params)
 Method overloading: return/call plugins.
 
- Public Member Functions inherited from DispatchableInterface
 dispatch (RequestInterface $request, ResponseInterface $response=null)
 Dispatch a request.
 

Static Public Member Functions

static getMethodFromAction ($action)
 Transform an "action" token into a method name.
 

Protected Member Functions

 attachDefaultListeners ()
 Register the default events for this controller.
 

Protected Attributes

 $plugins
 
 $request
 
 $response
 
 $event
 
 $events
 
 $eventIdentifier
 

Detailed Description

Abstract controller.

Convenience methods for pre-built plugins (

See Also
__call):

acceptableViewModelSelector(array $matchAgainst = null, bool $returnDefault = true, $resultReference = null) forward() | layout(string $template = null) |mixed params(string $param = null, mixed $default = null) redirect() url() createHttpNotFoundModel(Response $response)

Member Function Documentation

__call (   $method,
  $params 
)

Method overloading: return/call plugins.

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

Parameters
string$method
array$params
Returns
mixed
attachDefaultListeners ( )
protected

Register the default events for this controller.

Returns
void
dispatch ( Request  $request,
Response  $response = null 
)

Dispatch a request.

dispatch.pre, dispatch.post

Parameters
Request$request
null | Response$response
Returns
Response|mixed
getEvent ( )

Get the attached event.

Will create a new MvcEvent if none provided.

Returns
MvcEvent

Implements InjectApplicationEventInterface.

getEventManager ( )

Retrieve the event manager.

Lazy-loads an EventManager instance if none registered.

Returns
EventManagerInterface

Implements EventsCapableInterface.

static getMethodFromAction (   $action)
static

Transform an "action" token into a method name.

Parameters
string$action
Returns
string
getPluginManager ( )

Get plugin manager.

Returns
PluginManager
getRequest ( )

Get request object.

Returns
Request
getResponse ( )

Get response object.

Returns
Response
onDispatch ( MvcEvent  $e)
abstract

Execute the request.

Parameters
MvcEvent$e
Returns
mixed
plugin (   $name,
array  $options = null 
)

Get plugin instance.

Parameters
string$nameName of plugin to return
null | array$optionsOptions to pass to plugin constructor (if not already instantiated)
Returns
mixed
setEvent ( Event  $e)

Set an event to use during dispatch.

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

Parameters
Event$e
Returns
void

Implements InjectApplicationEventInterface.

setEventManager ( EventManagerInterface  $events)

Set the event manager instance used by this context.

Parameters
EventManagerInterface$events
Returns
AbstractController

Implements EventManagerAwareInterface.

setPluginManager ( PluginManager  $plugins)

Set plugin manager.

Parameters
PluginManager$plugins
Returns
AbstractController

Member Data Documentation

$event
protected
$eventIdentifier
protected
$events
protected
$plugins
protected
$request
protected
$response
protected