template Class Reference

Inheritance diagram for template:

iTemplate section

List of all members.

Public Member Functions

 __construct ($encoding='pass')
 read ()
 assign ($holder, $value)
 auto_assign ($data=null)
 display ()
 get_content ()
 __destruct ()

Public Attributes

 $dir = null
 $html = null
 $keep_unassigned = true

Protected Attributes

 $content = null

Private Member Functions

 _preparse ()
 _replace ()


Constructor & Destructor Documentation

template::__construct ( encoding = 'pass'  ) 

constructor

Example:

require_once 'class_template.php';
$tpl = new template();
$tpl->dir = 'templates/';
$tpl->html = 'default.html';
$tpl->read();

Parameters:
string $encoding could be iso-8859-1, utf-8, etc.. public

Reimplemented in section.

template::__destruct (  ) 

destructor

Will flush and close the output_buffer

public

Reimplemented in section.


Member Function Documentation

template::read (  ) 

read

Will read in the templeate file and invoke the _preparse methode
Will die if the template could not be found or is not readable.

See also:
$html

$dir public

Implements iTemplate.

Reimplemented in section.

template::_preparse (  )  [private]

_preparse

will parse the template to find values in curly brackets

private

template::assign ( holder,
value 
)

assign

Will assign a value to a placeholder.
If you should assign a null value this will result in the string 'NULL'.

Example:

....
$tpl->read();
$tpl->assign('UNIVERSE','Hello World');

Parameters:
string $holder A template placeholder
string $value What will be assigned to.
Returns:
bool true on success, false otherwise public

Implements iTemplate.

template::auto_assign ( data = null  ) 

auto_assign

Will assign all values to placeholders in this array.

Parameters:
array $data An array with placeholder=>value pairs
Returns:
bool true on success, false otherwise
See also:
assign public

Implements iTemplate.

template::_replace (  )  [private]

_replace

Will replace all assigned placeholders with the value

private

template::display (  ) 

display

Will echo out the final (html/xml whatsoever) code

public

Implements iTemplate.

Reimplemented in section.

template::get_content (  ) 

display

Will return the final (html/xml whatsoever) code

Returns:
string the processed template output public

Implements iTemplate.

Reimplemented in section.


Member Data Documentation

template::$dir = null

template::$html = null

template::$keep_unassigned = true

template::$content = null [protected]


The documentation for this class was generated from the following file:
Generated on Thu Nov 27 17:05:26 2008 for SKOR by  doxygen 1.5.3