Arbit - project tracking

Arbit - project tracking

API documentation :: Docs For Class arbitViewManager

Core::View::arbitViewManager

Class arbitViewManager

View manager, which handles a set of configured views and displays them using the configured view handler.

View manager, which handles a set of configured views and displays them using the configured view handler.

ezcMvcView
   |
   --arbitViewManager
Author(s):
Version:   $Revision: 1612 $
License:   GPL

Member Variables

protected array $commonCharsets = array(
// Very common charsets
'utf-8', 'iso-8859-1', 'koi-8',
// Common MS IE charsets
'windows-1250', 'windows-1251', 'windows-1252',
)

As it is not possible to get a list with supported charsets from the iconv extension, we just maintain a list of commonly available charsets here and hope they are supported everywhere.

As it is not possible to get a list with supported charsets from the iconv extension, we just maintain a list of commonly available charsets here and hope they are supported everywhere. If you notice some client does not support any of the here listed charsets, feel free to add new ones. They should all be lowercase.

protected string $defaultMimetype = 'text/html'
The preferred mimetype to use, if the client did not provide any information or does not provide any valid mimetypes, or the client accepts all mimetype at the same priority.

The preferred mimetype to use, if the client did not provide any information or does not provide any valid mimetypes, or the client accepts all mimetype at the same priority.

protected array $forcedMimetypes = array(
'xml' => 'text/xml',
'html' => 'text/html',
'txt' => 'text/text',
'js' => 'application/json',
'rss' => 'application/rss+xml',
)

List with extension mimetype assoziations, which force the view manager to use the configured view handler for the here given mimetype.

List with extension mimetype assoziations, which force the view manager to use the configured view handler for the here given mimetype.

protected array $viewHandler = array(
'text/html' => 'arbitViewXHtmlHandler',
'application/xhtml+xml' => 'arbitViewXHtmlHandler',
'text/xml' => 'arbitViewXmlHandler',
'text/text' => 'arbitViewTextHandler',
'application/json' => 'arbitViewJsonHandler',
'application/rss+xml' => 'arbitViewRssHandler',
)

Configured view handler, which is used to display the template with the parameters given by the controller for a set of mimetypes.

Configured view handler, which is used to display the template with the parameters given by the controller for a set of mimetypes.

Method Summary

public void __construct( $request , $result )
Construct view handler
public void createResponse( [ $result = null] )
Display controller result Lets the router parse the given URL and calls the controller depending on the router results.
public array(ezcMvcViewHandler) createZones( $layout )
The user-implemented that returns the zones.
protected string getClientEncoding( $supported , $default )
Get preferred encoding Check if the client support UTF-8, and uses it. a value we and the client supports.
protected string getPreferred( $supported , $available , $default )
Get preferred accept header value Matches the user provided priorized accept header list against the list of available mimtyoes / encodings /. the best matching value, or the default one, if no proper matches were found.
public void setViewHandler( $mimetype , $handler )
Set view handler for mimetype Set the view handler for a specific mimetype, like a renderer for text/xhtml content, or a renderer for text/xml or application/json.

Methods

__construct

void __construct( $request , $result )

Construct view handler

Construct view handler

Parameters:
Name Type Description
$request ezcMvcRequest
$result ezcMvcResult

createResponse

void createResponse( [ $result = null] )

Display controller result Lets the router parse the given URL and calls the controller depending on the router results.

Display controller result Lets the router parse the given URL and calls the controller depending on the router results. The sending of headers may be supressed by setting the optional third parameter to false, but this should normally only be used during testing. Optionally a ezcMvcResult may be passed, which then is processed instead of the result passed to the constructor.

Parameters:
Name Type Description
$result ezcMvcResult

createZones

array(ezcMvcViewHandler) createZones( bool $layout )

The user-implemented that returns the zones.

The user-implemented that returns the zones. This method creates all the zones that are needed to render a view. A zone is an array of elements that implement a view handler. The view handlers do not have to be of the same type, as long as they implement the ezcMvcViewHandler interface. The $layout parameter can be used to determine whether a "page layout" should be added to the list of zones. This can be useful in case you're incorporating many different applications. The $layout parameter will be set to true automatically for the top level createZones() method, which can then chose to add zones from other views as well. The createZones() methods from those other views should have the $layout parameter set to false.

Parameters:
Name Type Description
$layout bool

getClientEncoding

string getClientEncoding( $supported , string $default )

Get preferred encoding Check if the client support UTF-8, and uses it. a value we and the client supports.

Get preferred encoding Check if the client support UTF-8, and uses it. Otherwise we will use to a value we and the client supports. Once determined the encoding value is stored in the session, so that we know about it, when we need to decode client input values.

Parameters:
Name Type Description
$supported array
$default string

getPreferred

string getPreferred( $supported , $available , string $default )

Get preferred accept header value Matches the user provided priorized accept header list against the list of available mimtyoes / encodings /. the best matching value, or the default one, if no proper matches were found.

Get preferred accept header value Matches the user provided priorized accept header list against the list of available mimtyoes / encodings /... specific renderers and returns the best matching value, or the default one, if no proper matches were found.

Parameters:
Name Type Description
$supported array
$available array
$default string

setViewHandler

void setViewHandler( string $mimetype , string $handler )

Set view handler for mimetype Set the view handler for a specific mimetype, like a renderer for text/xhtml content, or a renderer for text/xml or application/json.

Set view handler for mimetype Set the view handler for a specific mimetype, like a renderer for text/xhtml content, or a renderer for text/xml or application/json.

Parameters:
Name Type Description
$mimetype string
$handler string
Documentation generated on Mon, 05 Apr 2010 14:02:03 +0200 by phpDocumentor 1.4.3