The Red Matrix
 All Classes Namespaces Files Functions Variables Pages
Template Class Reference
Inheritance diagram for Template:
ITemplateEngine

Public Member Functions

 replace_macros ($s, $r)
 
 get_markup_template ($file, $root='')
 

Public Attributes

 $r
 
 $search
 
 $replace
 
 $stack = array()
 
 $nodes = array()
 
 $done = false
 
 $d = false
 
 $lang = null
 
 $debug =false
 

Static Public Attributes

static $name ="internal"
 

Private Member Functions

 _preg_error ()
 
 _push_stack ()
 
 _pop_stack ()
 
 _get_var ($name, $retNoKey=false)
 
 _replcb_if ($args)
 
 _replcb_for ($args)
 
 _replcb_inc ($args)
 
 _replcb_debug ($args)
 
 _replcb_node ($m)
 
 _replcb ($m)
 
 _build_nodes ($s)
 
 var_replace ($s)
 
 replace ($s, $r)
 

Member Function Documentation

Template::_build_nodes (   $s)
private

Referenced by replace_macros().

Template::_get_var (   $name,
  $retNoKey = false 
)
private
Template::_pop_stack ( )
private

Referenced by _replcb_for(), and _replcb_inc().

Template::_preg_error ( )
private

Referenced by _build_nodes(), and replace_macros().

Template::_push_stack ( )
private

Referenced by _replcb_for(), and _replcb_inc().

Template::_replcb (   $m)
private
Template::_replcb_debug (   $args)
private

DEBUG node

{{ debug $var [$var [$var [...]]] }}{{ enddebug }}

replace node with

var_dump($var, $var, ...);
Template::_replcb_for (   $args)
private

FOR node

{{ for < $var>=""> as $name }}...{{ endfor }} {{ for < $var>=""> as $key=>$name }}...{{ endfor }}

Template::_replcb_if (   $args)
private

IF node

{{ if < $var>=""> }}...[{{ else }} ...] {{ endif }} {{ if < $var>="">==<val|$var> }}...[{{ else }} ...]{{ endif }} {{ if < $var>="">!=<val|$var> }}...[{{ else }} ...]{{ endif }}

Template::_replcb_inc (   $args)
private

INC node

{{ inc <templatefile> [with $var1=$var2] }}{{ endinc }}

Template::_replcb_node (   $m)
private
Template::get_markup_template (   $file,
  $root = '' 
)

Implements ITemplateEngine.

Referenced by _replcb_inc().

Template::replace (   $s,
  $r 
)
private

Referenced by _replcb_for(), and _replcb_inc().

Template::replace_macros (   $s,
  $r 
)

Implements ITemplateEngine.

Referenced by replace().

Template::var_replace (   $s)
private

regexp: $ literal $ ([)? optional open square bracket ([a-zA-Z0-9-_]+.?)+ var name, followed by optional dot, repeated at least 1 time (?(1)]) if there was opened square bracket (subgrup 1), match close bracket

Referenced by replace_macros().

Member Data Documentation

Template::$d = false
Template::$debug =false
Template::$done = false
Template::$lang = null
Template::$name ="internal"
static

Referenced by _get_var().

Template::$nodes = array()
Template::$r
Template::$replace
Template::$search
Template::$stack = array()

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