ZMObject
└─ZMView
public abstract class ZMView
extends ZMObject
| Constant Summary | |
|---|---|
| final static str | |
| final static str | |
| Fields inherited from org.zenmagick.core\ZMObject | |
|---|---|
| properties_ | |
| Method Summary | |
|---|---|
| void | Create new instance. |
| abstract string | asUrl(mixed request, string filename, string type, request The) Resolve the given (relative) templates filename into a url. |
| abstract boolean | exists(mixed request, string filename, string type, request The) Check if the given templates file exists. |
| abstract string | fetch(mixed request, string template, request The) Fetch/generate the contents of the given template. |
| string | Shortcut to generate the contents for the currenty set template. |
| string | Get the content type for this view. |
| string | Get the content encoding. |
| string | Get the template name. |
| mixed | getVar(string name) Get a variable. |
| array | getVars() Get all available variables in this view. |
| string | Get the view id. |
| abstract ZMViewUtils | Get view utils. |
| boolean | Check if this view is valid. |
| abstract string | path(string filename, string type) Resolve the given templates filename to a fully qualified filename. |
| 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 | |
|---|---|
| __construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton | |
public final static str RESOURCE = 'resource'
public final static str TEMPLATE = 'template'
public void __construct()
Create new instance.
public abstract string asUrl(mixed request, string filename, string type, request The)
Resolve the given (relative) templates filename into a url.
ZMView::TEMPLATE and ZMView::RESOURCE; default is ZMVIew::TEMPLATE.public abstract boolean exists(mixed request, string filename, string type, request The)
Check if the given templates file exists.
ZMView::TEMPLATE and ZMView::RESOURCE; default is ZMVIew::TEMPLATE.true if the file exists, false if not.public abstract string fetch(mixed request, string template, request The)
Fetch/generate the contents of the given template.
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'
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.
null.public string getEncoding()
Get the content encoding.
Return the value of the setting zenmagick.mvc.html.charset or UTF-8 as default.
public string getTemplate()
Get the template name.
public mixed getVar(string name)
Get a variable.
nullpublic array getVars()
Get all available variables in this view.
public string getViewId()
Get the view id.
public abstract ZMViewUtils getViewUtils()
Get view utils.
ZMViewUtils or null.public boolean isValid(ZMRequest request)
Check if this view is valid.
This is optional and it is up to the specific subclass to implement as appropriate.
true if the view is valid.public abstract string path(string filename, string type)
Resolve the given templates filename to a fully qualified filename.
ZMView::TEMPLATE and ZMView::RESOURCE; default is ZMVIew::TEMPLATE.null.public void setTemplate(string template)
Set the template name.
public void setVar(string name, mixed value)
Make a variable (value) available under the given name.
public void setVars(array vars)
Set multiple variables.
public void setViewId(string viewId)
Set the view id.
Base implementation of the
ZMViewinterface.