The Red Project
 All Classes Namespaces Files Functions Variables Pages
Template Class Reference

Public Member Functions

 replace ($s, $r)
 

Public Attributes

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

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)
 

Member Function Documentation

Template::_build_nodes (   $s)
private

Referenced by replace().

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().

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::replace (   $s,
  $r 
)

Referenced by _replcb_for(), and _replcb_inc().

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().

Member Data Documentation

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

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