ZenMagick 0.9.10


org.zenmagick.mvc.view\ZMSavantView
mvc\view\ZMSavantView.php at line 34

Class ZMSavantView

ZMObject
└─ZMView
└─ZMSavantView

public class ZMSavantView
extends ZMView

A Savant(3) view.

This class also introduced support for layouts.

The default viewDir value is views/.

Author:
DerManoMann

Method Summary
void

__construct()

Create new instance.

string

asUrl(mixed request, string filename, string type, request The)

{@inheritDoc}

boolean

exists(mixed request, string filename, string type, request The)

{@inheritDoc}

string

fetch(mixed request, string template, request The)

{@inheritDoc}

string

generate(ZMRequest request)

{@inheritDoc}

protected array

getFilterList()

Get a list of filter instances.

string

getFilters()

Get the configured filters.

string

getLayout()

Get the layout name.

array

getResourcePath(ZMRequest request)

Get the array of locations to search for resources.

Savant3

getSavant(ZMRequest request)

Get a preconfigured Savant3 instance.

string

getTemplate()

{@inheritDoc}

array

getTemplatePath(ZMRequest request)

Get the array of locations to search for templates.

string

getViewDir()

Get the views dir.

ZMViewUtils

getViewUtils()

{@inheritDoc}

string

path(string filename, string type)

{@inheritDoc}

void

setConfig(mixed config)

Set savant specific configuration options.

void

setFilters(string filters)

Set the filters.

void

setLayout(string layout)

Set the layout name.

void

setViewDir(string viewDir)

Set the views dir.

Methods inherited from org.zenmagick.mvc.view\ZMView
__construct, asUrl, exists, fetch, generate, getContentType, getEncoding, getTemplate, getVar, getVars, getViewId, getViewUtils, isValid, path, setTemplate, setVar, setVars, setViewId
Methods inherited from org.zenmagick.core\ZMObject
__construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton

Method Detail

mvc\view\ZMSavantView.php at line 46

__construct

public void __construct()

Create new instance.


mvc\view\ZMSavantView.php at line 304

asUrl

public string asUrl(mixed request, string filename, string type, request The)

Resolve the given (relative) templates filename into a url.

Parameters:
The - current request.
filename - The filename, relative to the template path.
type - The lookup type; valid values are ZMView::TEMPLATE and ZMView::RESOURCE; default is ZMVIew::TEMPLATE.
Returns:
A url.

mvc\view\ZMSavantView.php at line 297

exists

public boolean exists(mixed request, string filename, string type, request The)

Check if the given templates file exists.

Parameters:
The - current request.
filename - The filename, relative to the template path.
type - The lookup type; valid values are ZMView::TEMPLATE and ZMView::RESOURCE; default is ZMVIew::TEMPLATE.
Returns:
true if the file exists, false if not.

mvc\view\ZMSavantView.php at line 279

fetch

public 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\ZMSavantView.php at line 241

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\ZMSavantView.php at line 105

getFilterList

protected array getFilterList()

Get a list of filter instances.

Returns:
List of filter objects.

mvc\view\ZMSavantView.php at line 87

getFilters

public string getFilters()

Get the configured filters.

Returns:
A list of filter classes or null.

mvc\view\ZMSavantView.php at line 224

getLayout

public string getLayout()

Get the layout name.

Returns:
The layout name.

mvc\view\ZMSavantView.php at line 156

getResourcePath

public array getResourcePath(ZMRequest request)

Get the array of locations to search for resources.

This default implementation will just return getTemplatePath($request).

Parameters:
request - The current request.
Returns:
List of locations to look for resources.

mvc\view\ZMSavantView.php at line 191

getSavant

public Savant3 getSavant(ZMRequest request)

Get a preconfigured Savant3 instance.

Parameters:
request - The current request.
Returns:
A ready-to-use instance.

mvc\view\ZMSavantView.php at line 122

getTemplate

public string getTemplate()

Get the template name.

Returns:
The template name.

mvc\view\ZMSavantView.php at line 132

getTemplatePath

public array getTemplatePath(ZMRequest request)

Get the array of locations to search for templates.

Parameters:
request - The current request.
Returns:
List of locations to look for templates.

mvc\view\ZMSavantView.php at line 69

getViewDir

public string getViewDir()

Get the views dir.

Returns:
The views folder name, relative to the content folder.

mvc\view\ZMSavantView.php at line 231

getViewUtils

public ZMViewUtils getViewUtils()

Get view utils.

Returns:
An instance of ZMViewUtils or null.

mvc\view\ZMSavantView.php at line 311

path

public string path(string filename, string type)

Resolve the given templates filename to a fully qualified filename.

Parameters:
filename - The filename, relative to the template path.
type - The lookup type; valid values are ZMView::TEMPLATE and ZMView::RESOURCE; default is ZMVIew::TEMPLATE.
Returns:
A fully qualified filename or null.

mvc\view\ZMSavantView.php at line 176

setConfig

public void setConfig(mixed config)

Set savant specific configuration options.

Parameters:
config - Anything that can be converted into a map.

mvc\view\ZMSavantView.php at line 96

setFilters

public void setFilters(string filters)

Set the filters.

Parameters:
filters - Comma separated list of filter classes/bean definitions.

mvc\view\ZMSavantView.php at line 215

setLayout

public void setLayout(string layout)

Set the layout name.

Parameters:
layout - The layout name.

mvc\view\ZMSavantView.php at line 78

setViewDir

public void setViewDir(string viewDir)

Set the views dir.

Parameters:
viewDir - The views folder name, relative to the content folder.

ZenMagick 0.9.10