class twig extends base
Twig Template class.
Methods
template |
set_filenames(array $filename_array)
Sets the template filenames for handles. |
from base |
template |
destroy()
Clears all variables and blocks assigned to this template. |
from base |
template |
destroy_block_vars(string $blockname)
Reset/empty complete block |
from base |
template |
assign_vars(array $vararray)
Assign key variable pairs from an array |
from base |
template |
assign_var(string $varname, string $varval)
Assign a single scalar value to a single key. |
from base |
template |
append_var(string $varname, string $varval)
Append text to the string value stored in a key. |
from base |
array |
retrieve_vars(array $vararray)
Retrieve multiple template values |
from base |
mixed |
retrieve_var(string $varname)
Retreive a single scalar value from a single key. |
from base |
template |
assign_block_vars(string $blockname, array $vararray)
Assign key variable pairs from an array to a specified block |
from base |
template |
assign_block_vars_array(string $blockname, array $block_vars_array)
Assign key variable pairs from an array to a whole specified block loop |
from base |
array |
retrieve_block_vars(string $blockname, array $vararray)
Retrieve variable values from an specified block |
from base |
bool |
alter_block_array($blockname, array $vararray, $key = false, $mode = 'insert')
Change already assigned key variable pair (one-dimensional - single loop entry) |
from base |
mixed |
find_key_index($blockname, $key)
Find the index for a specified key in the innermost specified block |
from base |
__construct(path_helper $path_helper, config $config, context $context, environment $twig_environment, string $cache_path, user $user = null, array|ArrayAccess $extensions = array(), manager $extension_manager = null)
Constructor. |
||
template |
clear_cache()
Clear the cache |
|
array |
get_user_style()
Get the style tree of the style preferred by the current user |
|
template |
set_style(array $style_directories = array('styles'))
Set style location based on (current) user's chosen style. |
|
template |
set_custom_style(string|array $names, string|array $paths)
Set custom style location (able to use directory outside of phpBB). |
|
template |
display(string $handle)
Display a template for provided handle. |
|
template|string |
assign_display(string $handle, string $template_var = '', bool $return_content = true)
Display the handle and assign the output to a template variable or return the compiled result. |
|
string |
get_source_file_for_handle(string $handle)
Get path to template for handle (required for BBCode parser) |
Details
in base at line 36
public template
set_filenames(array $filename_array)
Sets the template filenames for handles.
in base at line 57
public template
destroy()
Clears all variables and blocks assigned to this template.
in base at line 67
public template
destroy_block_vars(string $blockname)
Reset/empty complete block
in base at line 77
public template
assign_vars(array $vararray)
Assign key variable pairs from an array
in base at line 90
public template
assign_var(string $varname, string $varval)
Assign a single scalar value to a single key.
Value can be a string, an integer or a boolean.
in base at line 100
public template
append_var(string $varname, string $varval)
Append text to the string value stored in a key.
Text is appended using the string concatenation operator (.).
in base at line 110
public array
retrieve_vars(array $vararray)
Retrieve multiple template values
in base at line 123
public mixed
retrieve_var(string $varname)
Retreive a single scalar value from a single key.
in base at line 131
public template
assign_block_vars(string $blockname, array $vararray)
Assign key variable pairs from an array to a specified block
in base at line 141
public template
assign_block_vars_array(string $blockname, array $block_vars_array)
Assign key variable pairs from an array to a whole specified block loop
in base at line 151
public array
retrieve_block_vars(string $blockname, array $vararray)
Retrieve variable values from an specified block
in base at line 159
public bool
alter_block_array($blockname, array $vararray, $key = false, $mode = 'insert')
Change already assigned key variable pair (one-dimensional - single loop entry)
An example of how to use this function: {@example alterblockarray.php}
in base at line 167
public mixed
find_key_index($blockname, $key)
Find the index for a specified key in the innermost specified block
at line 88
public
__construct(path_helper $path_helper, config $config, context $context, environment $twig_environment, string $cache_path, user $user = null, array|ArrayAccess $extensions = array(), manager $extension_manager = null)
Constructor.
at line 117
public template
clear_cache()
Clear the cache
at line 134
public array
get_user_style()
Get the style tree of the style preferred by the current user
at line 161
public template
set_style(array $style_directories = array('styles'))
Set style location based on (current) user's chosen style.
at line 230
public template
set_custom_style(string|array $names, string|array $paths)
Set custom style location (able to use directory outside of phpBB).
Note: Templates are still compiled to phpBB's cache directory.
at line 309
public template
display(string $handle)
Display a template for provided handle.
The template will be loaded and compiled, if necessary, first.
This function calls hooks.
at line 331
public template|string
assign_display(string $handle, string $template_var = '', bool $return_content = true)
Display the handle and assign the output to a template variable or return the compiled result.
at line 380
public string
get_source_file_for_handle(string $handle)
Get path to template for handle (required for BBCode parser)