Smarty template abstraction.
Smarty template abstraction.
This class wraps a Smarty instance with some Anewt-specific helper methods.
SmartyTemplate($template=null, $directories=null) ¶Constructor for the SmartyTemplate class.
$templateOptional parameter with the filename of the template to use. This is just a shortcut for $template->set('template', 'filename.tpl').
$directoriesOptional parameter with up to four items that will be passed to SmartyTemplate::setup().
setup($template_dir=null, $compile_dir=null, $config_dir=null, $cache_dir=null, $plugins_dir=null) ¶Configure the directories used for Smarty templates.
If parameters are omitted or if null values are supplied, the following constants are used as defaults: ANEWT_SMARTY_TEMPLATE_TEMPLATE_DIR, ANEWT_SMARTY_TEMPLATE_COMPILE_DIR, ANEWT_SMARTY_TEMPLATE_CONFIG_DIR and ANEWT_SMARTY_TEMPLATE_CACHE_DIR, ANEWT_SMARTY_TEMPLATE_PLUGIN_DIR. Define these constants in a configuration file.
$template_dirThe directory used for templates.
$compile_dirThe directory used for compiled templates.
$config_dirThe directory used for configuration files.
$cache_dirThe directory used for cached files.
$plugins_dirOne or more directories where plugins are stored.
render($template=null) ¶Renders this template to a string.
$templateThe filename of the template to use.
The resulting string after rendering by Smarty.
before_render() ¶Callback method before rendering starts.
This method does nothing by default. Override it if you want to do some special stuff before the actual rendering starts.
template_is_available($template=null) ¶Checks whether a given template is available.
$templateThe filename of the template to use.
AnewtContainer::_to_array()AnewtContainer::_add()AnewtContainer::delete()AnewtContainer::get()AnewtContainer::_isset()AnewtContainer::_seed()AnewtContainer::setdefault()AnewtContainer::getdefault()AnewtContainer::set()AnewtContainer::__isset()AnewtContainer::__set()AnewtContainer::__construct()AnewtContainer::is_set()AnewtContainer::add()AnewtContainer::_getdefault()AnewtContainer::__unset()AnewtContainer::seed()AnewtContainer::to_array()AnewtContainer::_get()AnewtContainer::__get()AnewtContainer::keys()AnewtContainer::clear()AnewtContainer::_keys()AnewtContainer::_set()