Public Member Functions | Protected Attributes

TemplateEngine Class Reference

Inheritance diagram for TemplateEngine:

List of all members.

Public Member Functions

 display ($template)
 queue_dirs ($dirs)
 template_exists ($template)
 fetch ($template)
 __get ($key)
 __set ($key, $value)
 __unset ($key)
 __isset ($key)
 assign ($key, $value= '')
 assigned ($key)
 clear ()
 append ($key, $value= '')
 add_template ($name, $file, $replace=false)

Protected Attributes

 $template_dir = null

Detailed Description

Habari TemplateEngine abstract base class

The TemplateEngine is an abstract base class to allow any template engine to supply templates for the UI. For an example implementation, see RawPHPEngine or SmartyEngine

Definition at line 18 of file templateengine.php.


Member Function Documentation

TemplateEngine::__get ( key  )  [abstract]

Tries to retrieve a variable from the internal array engine_vars. Method returns the value if succesful, returns false otherwise.

Parameters:
string $key name of variable

Reimplemented in RawPHPEngine.

TemplateEngine::__isset ( key  )  [abstract]

Detects if a variable is assigned to the template engine for use in constructing the template's output.

Parameters:
string $key name of variable
Returns:
boolean true if key is set, false if not set

Reimplemented in RawPHPEngine.

TemplateEngine::__set ( key,
value 
) [abstract]

Assigns a variable to the template engine for use in constructing the template's output.

Parameters:
string $key name of variable
mixed $value value of variable

Reimplemented in RawPHPEngine.

TemplateEngine::__unset ( key  )  [abstract]

Unassigns a variable to the template engine.

Parameters:
string $key name of variable

Reimplemented in RawPHPEngine.

TemplateEngine::add_template ( name,
file,
replace = false 
) [abstract]

Add a template to the list of available templates

Parameters:
string $name Name of the new template
string $file File of the template to add
boolean $replace If true, replace any existing template with this name

Reimplemented in RawPHPEngine.

TemplateEngine::append ( key,
value = '' 
) [abstract]

Appends to an existing variable more values

Parameters:
string $key name of variable
mixed $value value of variable

Reimplemented in RawPHPEngine.

TemplateEngine::assign ( key,
value = '' 
) [abstract]

Assigns a variable to the template engine for use in constructing the template's output.

Parameters:
string $key name of variable
mixed $value value of variable

Reimplemented in RawPHPEngine.

TemplateEngine::assigned ( key  )  [abstract]

Detects if a variable is assigned to the template engine for use in constructing the template's output.

Parameters:
string $key name of variable
Returns:
boolean true if key is set, false if not set

Reimplemented in RawPHPEngine.

TemplateEngine::clear (  )  [abstract]

Clear all of the assigned values

Reimplemented in RawPHPEngine.

TemplateEngine::display ( template  )  [abstract]

A function which outputs the result of a transposed template to the output stream

Parameters:
string $template Name of template to display

Reimplemented in HiEngine, and RawPHPEngine.

TemplateEngine::fetch ( template  )  [abstract]

A function which returns the content of the transposed template as a string

Parameters:
string $template Name of template to fetch

Reimplemented in RawPHPEngine.

TemplateEngine::queue_dirs ( dirs  )  [abstract]

Queue directories to be scanned for template files

Parameters:
array $dirs An array of directories to scan for templates

Reimplemented in RawPHPEngine.

TemplateEngine::template_exists ( template  )  [abstract]

Returns the existance of the specified template name

Parameters:
string $template Name of template to detect
Returns:
boolean True if the template exists, false if not

Reimplemented in RawPHPEngine.


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