Zeta Components Manual :: Docs For Class ezcMvcConfigurableDispatcher
MvcTools::ezcMvcConfigurableDispatcher
Class ezcMvcConfigurableDispatcher
This class implements an example dispatcher that can be configured through ezcMvcDispatcherConfiguration.
Source for this file: /MvcTools/src/dispatchers/configurable.php
Implements interfaces:
Version: | //autogentag// |
Member Variables
protected ezcMvcDispatcherConfiguration |
$configuration
Contains the configuration that determines which request parser, router, view handler and response writer are used. |
Method Summary
public ezcMvcConfigurableDispatcher |
__construct(
$configuration
)
Creates a new ezcMvcConfigurableDispatcher |
protected void |
checkRedirectLimit(
&$redirects
, $redirects
)
Checks whether the number of redirects does not exceed the limit, and increases the $redirects count. |
protected ezcMvcController |
createController(
$routingInformation
, $request
)
Creates the controller by using the routing information and request data. |
protected ezcMvcController |
getController(
$routingInformation
, $request
)
Uses the router (through createController()) to fetch the controller |
protected ezcMvcRequest |
getFatalRedirectRequest(
$request
, $result
, $e
)
Uses the configuration to fetch a fatal redirect request object |
protected ezcMvcRequestParser |
getRequestParser(
)
Uses the configuration to fetch the request parser |
protected ezcMvcResponseWriter |
getResponseWriter(
$routingInformation
, $request
, $result
, $response
)
Uses the configuration to fetch the response writer |
protected ezcMvcRouter |
getRouter(
$request
)
Uses the configuration to fetch the router |
protected ezcMvcView |
getView(
$routingInformation
, $request
, $result
)
Uses the configuration to fetch the view handler |
public void |
run(
)
Runs through the request, by using the configuration to obtain correct handlers. |
Methods
__construct
Creates a new ezcMvcConfigurableDispatcher
Parameters:
Name | Type | Description |
---|---|---|
$configuration |
ezcMvcDispatcherConfiguration |
checkRedirectLimit
Checks whether the number of redirects does not exceed the limit, and increases the $redirects count.
Parameters:
Name | Type | Description |
---|---|---|
$redirects |
int | |
&$redirects |
Exceptions:
Type | Description |
---|---|
ezcMvcInfiniteLoopException |
when the number of redirects exceeds the limit (25 by default). |
createController
Creates the controller by using the routing information and request data.
Parameters:
Name | Type | Description |
---|---|---|
$routingInformation |
ezcMvcRoutingInformation | |
$request |
ezcMvcRequest |
getController
Uses the router (through createController()) to fetch the controller
Parameters:
Name | Type | Description |
---|---|---|
$routingInformation |
ezcMvcRoutingInformation | |
$request |
ezcMvcRequest |
Exceptions:
Type | Description |
---|---|
ezcMvcInvalidConfiguration |
when the returned object is of the wrong class |
getFatalRedirectRequest
Uses the configuration to fetch a fatal redirect request object
Parameters:
Name | Type | Description |
---|---|---|
$request |
ezcMvcRequest | |
$result |
ezcMvcResult | |
$e |
Exception |
Exceptions:
Type | Description |
---|---|
ezcMvcInvalidConfiguration |
when the returned object is of the wrong class |
getRequestParser
Uses the configuration to fetch the request parser
Exceptions:
Type | Description |
---|---|
ezcMvcInvalidConfiguration |
when the returned object is of the wrong class |
getResponseWriter
Uses the configuration to fetch the response writer
Parameters:
Name | Type | Description |
---|---|---|
$routingInformation |
ezcMvcRoutingInformation | |
$request |
ezcMvcRequest | |
$result |
ezcMvcResult | |
$response |
ezcMvcResponse |
Exceptions:
Type | Description |
---|---|
ezcMvcInvalidConfiguration |
when the returned object is of the wrong class |
getRouter
Uses the configuration to fetch the router
Parameters:
Name | Type | Description |
---|---|---|
$request |
ezcMvcRequest |
Exceptions:
Type | Description |
---|---|
ezcMvcInvalidConfiguration |
when the returned object is of the wrong class |
getView
Uses the configuration to fetch the view handler
Parameters:
Name | Type | Description |
---|---|---|
$routingInformation |
ezcMvcRoutingInformation | |
$request |
ezcMvcRequest | |
$result |
ezcMvcResult |
Exceptions:
Type | Description |
---|---|
ezcMvcInvalidConfiguration |
when the returned object is of the wrong class |
run
Runs through the request, by using the configuration to obtain correct handlers.
Implementation of:
Method | Description |
---|---|
ezcMvcDispatcher::run() |
Runs the dispatcher. |