SmartyTemplate Class Reference

Smarty template abstraction. More...

List of all members.

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.


Detailed Description

Smarty template abstraction.

This class wraps a Smarty instance with some Anewt-specific helper methods.

Definition at line 28 of file smartytemplate.lib.php.


Member Function Documentation

SmartyTemplate::SmartyTemplate ( template = null,
directories = null 
)

Constructor for the SmartyTemplate class.

Parameters:
$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().
See also:
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.

Parameters:
$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.

Parameters:
$template The filename of the template to use.
Returns:
The resulting string after rendering by Smarty.

Definition at line 155 of file smartytemplate.lib.php.

SmartyTemplate::display ( template = null  ) 

Directly renders this template.

Parameters:
$template The filename of the template to use.
See also:
render()

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.

Parameters:
$template The filename of the template to use.

Definition at line 202 of file smartytemplate.lib.php.


The documentation for this class was generated from the following file:

Generated on Sun Aug 2 22:54:38 2009 for Anewt by  doxygen 1.5.9