Path

ez components / documentation / api reference / 2009.1.2 / mvctools


eZ Components 2009.1.2

MvcTools: ezcMvcConfigurableDispatcher

[ Tutorial ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcMvcConfigurableDispatcher

This class implements an example dispatcher that can be configured through ezcMvcDispatcherConfiguration. [source]

Implemented Interfaces

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

ezcMvcConfigurableDispatcher __construct( ezcMvcDispatcherConfiguration $configuration )
Creates a new ezcMvcConfigurableDispatcher

Parameters

Name Type Description
$configuration ezcMvcDispatcherConfiguration  

checkRedirectLimit

void checkRedirectLimit( &$redirects, int $redirects )
Checks whether the number of redirects does not exceed the limit, and increases the $redirects count.

Parameters

Name Type Description
$redirects int  
&$redirects  

Throws

ClassDescription
ezcMvcInfiniteLoopException when the number of redirects exceeds the limit (25 by default).

createController

ezcMvcController createController( ezcMvcRoutingInformation $routingInformation, ezcMvcRequest $request )
Creates the controller by using the routing information and request data.

Parameters

Name Type Description
$routingInformation ezcMvcRoutingInformation  
$request ezcMvcRequest  

getController

ezcMvcController getController( ezcMvcRoutingInformation $routingInformation, ezcMvcRequest $request )
Uses the router (through createController()) to fetch the controller

Parameters

Name Type Description
$routingInformation ezcMvcRoutingInformation  
$request ezcMvcRequest  

Throws

ClassDescription
ezcMvcInvalidConfiguration when the returned object is of the wrong class

getFatalRedirectRequest

ezcMvcRequest getFatalRedirectRequest( ezcMvcRequest $request, ezcMvcResult $result, $e )
Uses the configuration to fetch a fatal redirect request object

Parameters

Name Type Description
$request ezcMvcRequest  
$result ezcMvcResult  
$e Exception  

Throws

ClassDescription
ezcMvcInvalidConfiguration when the returned object is of the wrong class

getRequestParser

ezcMvcRequestParser getRequestParser( )
Uses the configuration to fetch the request parser

Throws

ClassDescription
ezcMvcInvalidConfiguration when the returned object is of the wrong class

getResponseWriter

ezcMvcResponseWriter getResponseWriter( ezcMvcRoutingInformation $routingInformation, ezcMvcRequest $request, ezcMvcResult $result, ezcMvcResponse $response )
Uses the configuration to fetch the response writer

Parameters

Name Type Description
$routingInformation ezcMvcRoutingInformation  
$request ezcMvcRequest  
$result ezcMvcResult  
$response ezcMvcResponse  

Throws

ClassDescription
ezcMvcInvalidConfiguration when the returned object is of the wrong class

getRouter

ezcMvcRouter getRouter( ezcMvcRequest $request )
Uses the configuration to fetch the router

Parameters

Name Type Description
$request ezcMvcRequest  

Throws

ClassDescription
ezcMvcInvalidConfiguration when the returned object is of the wrong class

getView

ezcMvcView getView( ezcMvcRoutingInformation $routingInformation, ezcMvcRequest $request, ezcMvcResult $result )
Uses the configuration to fetch the view handler

Parameters

Name Type Description
$routingInformation ezcMvcRoutingInformation  
$request ezcMvcRequest  
$result ezcMvcResult  

Throws

ClassDescription
ezcMvcInvalidConfiguration when the returned object is of the wrong class

run

void run( )
Runs through the request, by using the configuration to obtain correct handlers.

Last updated: Tue, 01 Sep 2009