|
| assign ($variable, $value=null) |
|
| draw ($tpl_name, $return_string=false) |
|
| cache ($tpl_name, $expire_time=self::CACHE_EXPIRE_TIME, $cache_id=null) |
|
| const_replace ($html, $tag_left_delimiter, $tag_right_delimiter, $php_left_delimiter=null, $php_right_delimiter=null, $loop_level=null, $echo=null) |
|
| func_replace ($html, $tag_left_delimiter, $tag_right_delimiter, $php_left_delimiter=null, $php_right_delimiter=null, $loop_level=null, $echo=null) |
|
| var_replace ($html, $tag_left_delimiter, $tag_right_delimiter, $php_left_delimiter=null, $php_right_delimiter=null, $loop_level=null, $echo=null) |
|
|
| $var = array() |
|
| $cache = false |
|
| $cache_id = null |
|
const | CACHE_EXPIRE_TIME = 3600 |
|
|
static | $tpl_dir = "tpl/" |
|
static | $cache_dir = "tmp/" |
|
static | $base_url = null |
|
static | $tpl_ext = "html" |
|
static | $path_replace = true |
|
static | $path_replace_list = array( 'a', 'img', 'link', 'script', 'input' ) |
|
static | $black_list = array( '\$this', 'raintpl::', 'self::', '_SESSION', '_SERVER', '_ENV', 'eval', 'exec', 'unlink', 'rmdir' ) |
|
static | $check_template_update = true |
|
static | $php_enabled = false |
|
static | $debug = false |
|
|
static | $config_name_sum = array() |
|
RainTPL::assign |
( |
|
$variable, |
|
|
|
$value = null |
|
) |
| |
Assign variable eg. $t->assign('name','mickey');
- Parameters
-
mixed | $variable_name | Name of template variable or associative array name/value |
mixed | $value | value assigned to this variable. Not set if variable_name is an associative array |
RainTPL::cache |
( |
|
$tpl_name, |
|
|
|
$expire_time = self::CACHE_EXPIRE_TIME , |
|
|
|
$cache_id = null |
|
) |
| |
If exists a valid cache for this template it returns the cache
- Parameters
-
string | $tpl_name | Name of template (set the same of draw) |
int | $expiration_time | Set after how many seconds the cache expire and must be regenerated |
- Returns
- string it return the HTML or null if the cache must be recreated
RainTPL::compileCode |
( |
|
$parsed_code | ) |
|
|
protected |
Compile the code protected
RainTPL::compileFile |
( |
|
$tpl_basename, |
|
|
|
$tpl_basedir, |
|
|
|
$tpl_filename, |
|
|
|
$cache_dir, |
|
|
|
$compiled_filename |
|
) |
| |
|
protected |
Compile and write the compiled template file protected
RainTPL::compileTemplate |
( |
|
$template_code, |
|
|
|
$tpl_basedir |
|
) |
| |
|
protected |
Compile template protected
static RainTPL::configure |
( |
|
$setting, |
|
|
|
$value = null |
|
) |
| |
|
static |
RainTPL::draw |
( |
|
$tpl_name, |
|
|
|
$return_string = false |
|
) |
| |
Draw the template eg. $html = $tpl->draw( 'demo', TRUE ); // return template in string or $tpl->draw( $tpl_name ); // echo the template
- Parameters
-
string | $tpl_name | template to load |
boolean | $return_string | true=return a string, false=echo the template |
- Returns
- string
RainTPL::function_check |
( |
|
$code | ) |
|
|
protected |
Check if function is in black list (sandbox)
- Parameters
-
RainTPL::path_replace |
( |
|
$html, |
|
|
|
$tpl_basedir |
|
) |
| |
|
protected |
replace the path of image src, link href and a href. url => template_dir/url url# => url http://url => http://url
- Parameters
-
- Returns
- string html sostituito
Prints debug info about exception or passes it further if debug is disabled.
- Parameters
-
- Returns
- string
RainTPL::reduce_path |
( |
|
$path | ) |
|
|
protected |
Reduce a path, eg. www/library/../filepath//file => www/filepath/file
- Parameters
-
- Returns
- type
RainTPL::xml_reSubstitution |
( |
|
$capture | ) |
|
|
protected |
execute stripslaches() on the xml block. Invoqued by preg_replace_callback function below protected
RainTPL::$check_template_update = true |
|
static |
Check template. true: checks template update time, if changed it compile them false: loads the compiled template. Set false if server doesn't have write permission for cache_directory.
The documentation for this class was generated from the following file: