Savant3
└─ZMSavant
public class ZMSavant
extends Savant3
| Method Summary | |
|---|---|
| void | __construct(mixed config) Create a new instance. |
| string | asUrl(string filename, string type) Resolve the given (relative) templates filename into a url. |
| string | block(string blockId, array args) Call the block handler for the given block id. |
| boolean | exists(string filename, string type) Check if the given template/resource file exists. |
| void | fetch(mixed tpl) {@inheritDoc} Adds a hook for flexible caching. |
| string | path(string filename, string type) Resolve the given templates filename to a fully qualified filename. |
public void __construct(mixed config)
Create a new instance.
public string asUrl(string filename, string type)
Resolve the given (relative) templates filename into a url.
ZMView::TEMPLATE and ZMView::RESOURCE; default is ZMVIew::TEMPLATE.public string block(string blockId, array args)
Call the block handler for the given block id.
All registered block contents that is found at this time will be returned as ready-to-use HTML.
public boolean exists(string filename, string type)
Check if the given template/resource file exists.
ZMView::TEMPLATE and ZMView::RESOURCE; default is ZMVIew::TEMPLATE.true if the file exists, false if not.public void fetch(mixed tpl)
Adds a hook for flexible caching.
public 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.
Custom Savant(3).
Adds some convenience methods to access templates.
ATTENTION: These methods only make sense if called from within a template.
Also, adds support for caching. The config map supports a key cache that is expected to be a class name that implements the following two methods:
lookup($tpl)nullshould be returned.save($tpl, $contents)It should be noted that it is the reponsibility of the cache class to decide whether a given template can be cached or not.