Public Member Functions | |
| SmartyTemplate ($template=null, $directories=null) | |
| Constructor for the SmartyTemplate class. | |
| setup ($template_dir=null, $compile_dir=null, $config_dir=null, $cache_dir=null, $plugins_dir=null) | |
| Configure the directories used for Smarty templates. | |
| render ($template=null) | |
| Renders this template to a string. | |
| display ($template=null) | |
| Directly renders this template. | |
| before_render () | |
| Callback method before rendering starts. | |
| template_is_available ($template=null) | |
| Checks whether a given template is available. | |
Public Attributes | |
| $smarty | |
| Smarty instance. | |
This class wraps a Smarty instance with some Anewt-specific helper methods.
Definition at line 28 of file smartytemplate.lib.php.
| SmartyTemplate::SmartyTemplate | ( | $ | template = null, |
|
| $ | directories = null | |||
| ) |
Constructor for the SmartyTemplate class.
| $template | Optional parameter with the filename of the template to use. This is just a shortcut for $template->set('template', 'filename.tpl'). | |
| $directories | Optional parameter with up to four items that will be passed to SmartyTemplate::setup(). |
Definition at line 43 of file smartytemplate.lib.php.
| SmartyTemplate::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_dir | The directory used for templates. | |
| $compile_dir | The directory used for compiled templates. | |
| $config_dir | The directory used for configuration files. | |
| $cache_dir | The directory used for cached files. | |
| $plugins_dir | One or more directories where plugins are stored. |
Definition at line 99 of file smartytemplate.lib.php.
| SmartyTemplate::render | ( | $ | template = null |
) |
Renders this template to a string.
| $template | The filename of the template to use. |
Definition at line 155 of file smartytemplate.lib.php.
| SmartyTemplate::display | ( | $ | template = null |
) |
Directly renders this template.
| $template | The filename of the template to use. |
Definition at line 181 of file smartytemplate.lib.php.
| SmartyTemplate::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.
Definition at line 192 of file smartytemplate.lib.php.
| SmartyTemplate::template_is_available | ( | $ | template = null |
) |
Checks whether a given template is available.
| $template | The filename of the template to use. |
Definition at line 202 of file smartytemplate.lib.php.
1.5.9