Zeta Components - high quality PHP components

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

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
Exceptions:
Type Description
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
Exceptions:
Type Description
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
Exceptions:
Type Description
ezcMvcInvalidConfiguration when the returned object is of the wrong class

getRequestParser

ezcMvcRequestParser getRequestParser( )

Uses the configuration to fetch the request parser

Exceptions:
Type Description
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
Exceptions:
Type Description
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
Exceptions:
Type Description
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
Exceptions:
Type Description
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.

Implementation of:
Method Description
ezcMvcDispatcher::run() Runs the dispatcher.
Documentation generated by phpDocumentor 1.4.3