BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
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

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

Constructor.

Parameters
string$file
Exceptions
InvalidArgumentException

Member Function Documentation

Text_Template::render ( )

Renders the template and returns the result.

Returns
string
Text_Template::renderTo (   $target)

Renders the template and writes the result to a file.

Parameters
string$target
Text_Template::setFile (   $file)

Sets the template file.

Parameters
string$file
Exceptions
InvalidArgumentException
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: