ZenMagick 0.9.8


org.zenmagick.mvc.view.ZMView
\mvc\view\ZMView.php at line 31

Class ZMView

ZMObject
└─ZMView

public abstract class ZMView
extends ZMObject

Base implementation of the ZMView interface.

Author:
DerManoMann
Version:
$Id: ZMView.php 2792 2009-12-29 02:23:34Z dermanomann $

Fields inherited from org.zenmagick.core.ZMObject
properties_
Constructor Summary

ZMView()

Create new instance.

Method Summary
abstract string

fetch(mixed request, string template, request The)

Fetch/generate the contents of the given template.

string

generate(ZMRequest request)

Shortcut to generate the contents for the currenty set template.

string

getContentType()

Get the content type for this view.

string

getEncoding()

Get the content encoding.

string

getTemplate()

Get the template name.

array

getVars()

Get all available variables in this view.

string

getViewId()

Get the view id.

boolean

isValid()

Check if this view is valid.

void

setTemplate(string template)

Set the template name.

void

setVar(string name, mixed value)

Make a variable (value) available under the given name.

void

setVars(array vars)

Set multiple variables.

void

setViewId(string viewId)

Set the view id.

Methods inherited from org.zenmagick.core.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Constructor Detail

\mvc\view\ZMView.php at line 40

ZMView

public ZMView()

Create new instance.


Method Detail

\mvc\view\ZMView.php at line 171

fetch

public abstract string fetch(mixed request, string template, request The)

Fetch/generate the contents of the given template.

Parameters:
The - current request.
template - The template name.
Returns:
The contents.

\mvc\view\ZMView.php at line 102

generate

public string generate(ZMRequest request)

Shortcut to generate the contents for the currenty set template.

The template extension is taken from the 'zenmagick.mvc.templates.ext'

Parameters:
request - The current request.
Returns:
The contents.

\mvc\view\ZMView.php at line 149

getContentType

public string getContentType()

Get the content type for this view.

Return the value of the setting zenmagick.mvc.html.contentType or text/html as default.

Returns:
The content type or null.

\mvc\view\ZMView.php at line 160

getEncoding

public string getEncoding()

Get the content encoding.

Return the value of the setting zenmagick.mvc.html.charset or UTF-8 as default.

Returns:
The content encoding.

\mvc\view\ZMView.php at line 129

getTemplate

public string getTemplate()

Get the template name.

Returns:
The template name.

\mvc\view\ZMView.php at line 79

getVars

public array getVars()

Get all available variables in this view.

Returns:
A name/value map.

\mvc\view\ZMView.php at line 111

getViewId

public string getViewId()

Get the view id.

Returns:
The view id.

\mvc\view\ZMView.php at line 90

isValid

public boolean isValid()

Check if this view is valid.

This is optional and it is up to the specific subclass to implement as appropriate.

Returns:
true if the view is valid.

\mvc\view\ZMView.php at line 138

setTemplate

public void setTemplate(string template)

Set the template name.

Parameters:
template - The new template name.

\mvc\view\ZMView.php at line 61

setVar

public void setVar(string name, mixed value)

Make a variable (value) available under the given name.

Parameters:
name - The variable name.
value - The value.

\mvc\view\ZMView.php at line 70

setVars

public void setVars(array vars)

Set multiple variables.

Parameters:
vars - A map of name/value pairs.

\mvc\view\ZMView.php at line 120

setViewId

public void setViewId(string viewId)

Set the view id.

Parameters:
viewId - The new view id.

ZenMagick 0.9.8