Property | Type | Description | |
---|---|---|---|
$safes | |||
$var_is_safe | Flag the current variable as safe. This means that escape won't be called if autoescape is activated (which is activated by default) |
Property | Type | Description | |
---|---|---|---|
$append | |||
$autoescape | * compiler options | ||
$block_var | properties {{{ | ||
$blocks | |||
$check_function | |||
$context | Context at compile time | ||
$debug | Debug file | ||
$dot_as_object | |||
$echo_concat | |||
$enable_load | |||
$file | |||
$forid | |||
$forloop | |||
$generator | |||
$global_context | |||
$if_empty | |||
$in_block | number of blocks :-) | ||
$is_exec_enabled | |||
$line | |||
$name | |||
$ob_start | output buffers :-) | ||
$prepend_op | |||
$strip_whitespace | |||
$sub_template | |||
$var_alias | Table which contains all variables aliases defined in the template |
Method | Description | |
---|---|---|
Error ( $err ) | Throw an exception and appends information about the template (the path and the last processed line). | |
__construct ( ) | }}} | |
compile ( $code, $name = NULL, $file = NULL ) | Compile ($code, $name=NULL) {{{ | |
compile_file ( string $file, boolean $safe = FALSE, $context = [] ) : Generated | Compile a file | |
do_filtering ( $name, $args ) | ||
do_print ( Haanga_AST $code, $stmt ) | Print {{{ | |
expr_call_base_template ( ) | Generate code to call base template | |
generate_op_alias ( $details, &$body ) | ||
generate_op_autoescape ( $details, &$body ) | autoescape ON|OFF {{{ | |
generate_op_custom_tag ( $details, &$body ) | Generate needed code for custom tags (tags that aren't handled by the compiler). | |
generate_op_filter ( $details, &$body ) | ||
generate_op_set ( $details, &$body ) | }}} | |
generate_op_spacefull ( $details, &$body ) | {% spacefull %} Set to OFF strip_whitespace for a block (the compiler option) {{{ | |
generate_variable_name ( $variable, $special = true ) | Get variable name {{{ | |
getOpCodes ( string $code, string $file ) : Haanga_AST | Compile the $code and return the "opcodes" (the Abstract syntax tree). | |
getOption ( $option ) | getOption($option) {{{ | |
getScopeVariable ( $part = NULL, $string = FALSE ) | ||
get_base_template ( array $base ) : string | Handle {% base "" %} definition. By default only static (string) are supported, but this can be overrided on subclasses. | |
get_context ( $variable ) | ||
get_custom_filter ( $name ) | Custom Filters {{{ | |
get_custom_tag ( $name ) | Custom Tags {{{ | |
get_filtered_var ( array $variable, &$varname, boolean $accept_string = NULL ) : expr | This method handles all the filtered variable (piped_list(X)'s output in the parser. | |
get_function_name ( $name ) | get_function_name(string $name) {{{ | |
get_template_name ( ) | get_template_name() {{{ | |
isMethod ( $varname, &$expr ) | }}} | |
is_safe ( $name ) | ||
is_var_filter ( $cmd ) | is_expr methods {{{ | |
main_cli ( ) | * }}} | |
ob_start ( &$body ) | Start a new buffering | |
reset ( ) | reset() {{{ | |
setDebug ( $file ) | setDebug($file) {{{ | |
setOption ( $option, $value ) : void | Set Compiler option. | |
set_context ( $varname, $value ) | Variables context | |
set_safe ( $name ) | * variable safety {{{ | |
set_template_name ( $path ) | Set template name {{{ | |
set_unsafe ( $name ) | ||
var_is_object ( array $variable, $default = NULL ) |
Method | Description | |
---|---|---|
check_expr ( &$expr ) | Check the current expr {{{ | |
compile_required_template ( $file ) | Override template {{{ | |
generate_op_base ( ) | {% base "foo.html" %} {{{ | |
generate_op_block ( $details, &$body ) | {% block 'name' %} . | |
generate_op_code ( $parsed, &$body ) | Main Loop {{{ | |
generate_op_comment ( $details, &$body ) | {# something #} {{{ | |
generate_op_html ( $details, &$body ) | Handle HTML code {{{ | |
generate_op_if ( $details, &$body ) |
{% if |
|
generate_op_ifchanged ( $details, &$body ) |
ifchanged [ | |
generate_op_ifequal ( $details, &$body ) |
ifequal|ifnot equal |
|
generate_op_include ( $details, &$body ) |
include "file.html" | include |
|
generate_op_loop ( $details, &$body ) |
for [ |
|
generate_op_print_var ( $details, &$body ) | Generate code to print a variable with its filters, if there is any. | |
generate_op_regroup ( $details, &$body ) |
regroup |
public Error ( $err ) |
final public compile ( $code, $name = NULL, $file = NULL ) |
final public compile_file ( string $file, boolean $safe = FALSE, $context = [] ) : Generated | ||
$file | string | |
$safe | boolean | Whether or not add check if the function is already defined @return Generated PHP code |
return | Generated |
protected compile_required_template ( $file ) |
public expr_call_base_template ( ) |
public generate_op_autoescape ( $details, &$body ) |
protected generate_op_block ( $details, &$body ) |
protected generate_op_comment ( $details, &$body ) |
public generate_op_custom_tag ( $details, &$body ) |
protected generate_op_html ( $details, &$body ) |
protected generate_op_if ( $details, &$body ) |
protected generate_op_ifchanged ( $details, &$body ) |
protected generate_op_ifequal ( $details, &$body ) |
protected generate_op_include ( $details, &$body ) |
protected generate_op_print_var ( $details, &$body ) |
protected generate_op_regroup ( $details, &$body ) |
public generate_op_spacefull ( $details, &$body ) |
public generate_variable_name ( $variable, $special = true ) |
public getOpCodes ( string $code, string $file ) : Haanga_AST | ||
$code | string | |
$file | string | File path (used for erro reporting) @return Haanga_AST |
return | Haanga_AST |
public get_base_template ( array $base ) : string | ||
$base | array | Base structure @return string Generated source code |
return | string |
public get_filtered_var ( array $variable, &$varname, boolean $accept_string = NULL ) : expr | ||
$variable | array | |
$accept_string | boolean | |
return | expr |
public get_function_name ( $name ) |
public set_context ( $varname, $value ) |
public var_is_object ( array $variable, $default = NULL ) | ||
$variable | array |
protected $var_alias |