PHP Class Habari\RawPHPEngine

The RawPHPEngine is a subclass of the abstract TemplateEngine class which is intended for those theme designers who choose to use raw PHP to design theme templates.
Inheritance: extends TemplateEngine
Show file Open project: habari/system

Protected Properties

Property Type Description
$available_templates
$engine_vars Internal data to be extracted into template symbol table
$loaded_templates
$template_map
$var_stack

Public Methods

Method Description
__construct ( ) Constructor for RawPHPEngine
__get ( $key ) Tries to retrieve a variable from the internal array engine_vars.
__isset ( $key ) Detects if a variable is assigned to the template engine for use in constructing the template's output.
__set ( $key, $value ) Assigns a variable to the template engine for use in constructing the template's output.
__unset ( $key ) Unassigns a variable to the template engine.
add_template ( string $name, string $file, boolean $replace = false ) Adds and/or replaces a previously queued template in the available template listing
append ( $key, $value = '' ) Appends to an existing variable more values
assign ( $key, $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 template variables
display ( $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 ( string | array $dirs ) Search directories for templates to use Templates are always taken from the first directory they're found in.
template_exists ( string $template ) Returns the existance of the specified template name

Method Details

__construct() public method

Sets up default values for required settings.
public __construct ( )

__get() public method

Method returns the value if succesful, returns false otherwise.
public __get ( $key )

__isset() public method

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

__set() public method

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

__unset() public method

Unassigns a variable to the template engine.
public __unset ( $key )

add_template() public method

Adds and/or replaces a previously queued template in the available template listing
public add_template ( string $name, string $file, boolean $replace = false )
$name string The name of the template
$file string The file of the template
$replace boolean

append() public method

Appends to an existing variable more values
public append ( $key, $value = '' )

assign() public method

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

assigned() public method

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

clear() public method

Clear all of the assigned template variables
public clear ( )

display() public method

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

fetch() public method

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

queue_dirs() public method

To override this behavior, the template must be specifically added via ->add_template()
See also: add_template
public queue_dirs ( string | array $dirs )
$dirs string | array A directory to look for templates in

template_exists() public method

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

Property Details

$available_templates protected property

protected $available_templates

$engine_vars protected property

Internal data to be extracted into template symbol table
protected $engine_vars

$loaded_templates protected property

protected $loaded_templates

$template_map protected property

protected $template_map

$var_stack protected property

protected $var_stack