Lggr
Public Member Functions | Protected Attributes | List of all members
Text_Template Class Reference

Public Member Functions

 __construct ($file='', $openDelimiter='{', $closeDelimiter='}')
 
 setFile ($file)
 
 setVar (array $values, $merge=TRUE)
 
 render ()
 
 renderTo ($target)
 

Protected Attributes

 $template = ''
 
 $openDelimiter = '{'
 
 $closeDelimiter = '}'
 
 $values = array()
 

Detailed Description

A simple template engine.

Since
Class available since Release 1.0.0

Constructor & Destructor Documentation

◆ __construct()

Text_Template::__construct (   $file = '',
  $openDelimiter = '{',
  $closeDelimiter = '}' 
)

Constructor.

Parameters
string$file
Exceptions
InvalidArgumentException

Member Function Documentation

◆ render()

Text_Template::render ( )

Renders the template and returns the result.

Returns
string

◆ renderTo()

Text_Template::renderTo (   $target)

Renders the template and writes the result to a file.

Parameters
string$target

◆ setFile()

Text_Template::setFile (   $file)

Sets the template file.

Parameters
string$file
Exceptions
InvalidArgumentException

◆ setVar()

Text_Template::setVar ( array  $values,
  $merge = TRUE 
)

Sets one or more template variables.

Parameters
array$values
bool$merge

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