PHP Класс Habari\TemplateEngine

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
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$template_dir directory where the template resides

Открытые методы

Метод Описание
__construct ( )
__get ( string $key ) Tries to retrieve a variable from the internal array engine_vars.
__isset ( string $key ) Detects if a variable is assigned to the template engine for use in constructing the template's output.
__set ( string $key, mixed $value ) Assigns a variable to the template engine for use in constructing the template's output.
__unset ( string $key ) Unassigns a variable to the template engine.
add_template ( string $name, string $file, boolean $replace = false ) Add a template to the list of available templates
append ( string $key, mixed $value = '' ) Appends to an existing variable more values
assign ( string $key, mixed $value = '' ) Assigns a variable to the template engine for use in constructing the template's output.
assigned ( string $key ) Detects if a variable is assigned to the template engine for use in constructing the template's output.
clear ( ) Clear all of the assigned values
display ( string $template ) A function which outputs the result of a transposed template to the output stream
fetch ( string $template ) A function which returns the content of the transposed template as a string
queue_dirs ( array $dirs ) Queue directories to be scanned for template files
template_exists ( string $template ) Returns the existance of the specified template name

Описание методов

__construct() абстрактный публичный Метод

abstract public __construct ( )

__get() абстрактный публичный Метод

Method returns the value if succesful, returns false otherwise.
abstract public __get ( string $key )
$key string name of variable

__isset() абстрактный публичный Метод

Detects if a variable is assigned to the template engine for use in constructing the template's output.
abstract public __isset ( string $key )
$key string name of variable

__set() абстрактный публичный Метод

Assigns a variable to the template engine for use in constructing the template's output.
abstract public __set ( string $key, mixed $value )
$key string name of variable
$value mixed value of variable

__unset() абстрактный публичный Метод

Unassigns a variable to the template engine.
abstract public __unset ( string $key )
$key string name of variable

add_template() абстрактный публичный Метод

Add a template to the list of available templates
abstract public add_template ( string $name, string $file, boolean $replace = false )
$name string Name of the new template
$file string File of the template to add
$replace boolean If true, replace any existing template with this name

append() абстрактный публичный Метод

Appends to an existing variable more values
abstract public append ( string $key, mixed $value = '' )
$key string name of variable
$value mixed value of variable

assign() абстрактный публичный Метод

Assigns a variable to the template engine for use in constructing the template's output.
abstract public assign ( string $key, mixed $value = '' )
$key string name of variable
$value mixed value of variable

assigned() абстрактный публичный Метод

Detects if a variable is assigned to the template engine for use in constructing the template's output.
abstract public assigned ( string $key )
$key string name of variable

clear() абстрактный публичный Метод

Clear all of the assigned values
abstract public clear ( )

display() абстрактный публичный Метод

A function which outputs the result of a transposed template to the output stream
abstract public display ( string $template )
$template string Name of template to display

fetch() абстрактный публичный Метод

A function which returns the content of the transposed template as a string
abstract public fetch ( string $template )
$template string Name of template to fetch

queue_dirs() абстрактный публичный Метод

Queue directories to be scanned for template files
abstract public queue_dirs ( array $dirs )
$dirs array An array of directories to scan for templates

template_exists() абстрактный публичный Метод

Returns the existance of the specified template name
abstract public template_exists ( string $template )
$template string Name of template to detect

Описание свойств

$template_dir защищенное свойство

directory where the template resides
protected $template_dir