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
파일 보기 프로젝트 열기: habari/system

보호된 프로퍼티들

프로퍼티 타입 설명
$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