Methods summary
public
|
#
enable_strict_mode( )
Enables the strict mode. If a variable that does not exist in the object is requested,
then an exception will be raised.
Enables the strict mode. If a variable that does not exist in the object is requested, then an exception will be raised.
|
public
|
#
disable_strict_mode( )
Disables the strict mode. If a variable that does not exist in the object is requested,
then an empty value will be returned.
Disables the strict mode. If a variable that does not exist in the object is requested, then an empty value will be returned.
|
public
|
#
auto_load_frequent_vars( )
Loads the most common vars which are useful in the whole PHPBoost templates. The variables are:
- THEME the theme used by the current user
- LANG the lang used by the current user
- IS_USER_CONNECTED tells whether the user is connected (member, moderator or administrator)
- IS_ADMIN tells whether the user is administrator
- IS_MODERATOR tells whether the user is moderator
- PATH_TO_ROOT is the path which starts from the domain root (in HTTP context) and goes to the PHPBoost
root. For instance if PHPBoost is installed at www.example.com/directory/, its value will be /directory.
- PHP_PATH_TO_ROOT is the server side path, it's the path which goes to the PHPBoost's root.
- TOKEN is the CSRF protection token. It's to use in the critical actions to show that the user really
intended doing the action
- REWRITED_SCRIPT the current url
Loads the most common vars which are useful in the whole PHPBoost templates. The variables are:
- THEME the theme used by the current user
- LANG the lang used by the current user
- IS_USER_CONNECTED tells whether the user is connected (member, moderator or administrator)
- IS_ADMIN tells whether the user is administrator
- IS_MODERATOR tells whether the user is moderator
- PATH_TO_ROOT is the path which starts from the domain root (in HTTP context) and goes to the PHPBoost
root. For instance if PHPBoost is installed at www.example.com/directory/, its value will be /directory.
- PHP_PATH_TO_ROOT is the server side path, it's the path which goes to the PHPBoost's root.
- TOKEN is the CSRF protection token. It's to use in the critical actions to show that the user really
intended doing the action
- REWRITED_SCRIPT the current url
|
public
|
#
put( $key, $value )
Assigns the value
$value
to the template variable of name
$key
Assigns the value
$value
to the template variable of name
$key
Parameters
- $key
- template parameter name
- $value
- template parameter value
|
public
|
#
put_all( array $vars )
Assigns template variables. It could be simple variables, loop or subtemplates.
Assigns template variables. It could be simple variables, loop or subtemplates.
Parameters
- $vars
A map key => value where
$value
will be assigned to the template variable of name
$key
|
public
|
#
assign_block_vars( string $block_name, array $array_vars, array $subtemplates = array() )
Assigns a template block. A block represents a loop and has a name which be used in your template file to indicate which loop you want to browse.
To know what syntax to use to browse a loop, see the class description, there are examples.
Assigns a template block. A block represents a loop and has a name which be used in your template file to indicate which loop you want to browse.
To know what syntax to use to browse a loop, see the class description, there are examples.
Parameters
- $block_name
- Block name.
- $array_vars
- A map var_name => var_value. Generally, var_name is written in caps characters.
- $subtemplates
- The list of subtemplates to embed in the loop's iteration.
|
public
mixed[]
|
#
get_block( string $blockname )
Returns the block $blockname in the template block list
Returns the block $blockname in the template block list
Parameters
- $blockname
- the blockname of the block to retrieve
Returns
mixed[] the requested block
|
public
mixed[]
|
#
get_block_from_list( string $blockname, mixed[] $parent_block )
Returns the block $blockname in the parent_block
Returns the block $blockname in the parent_block
Parameters
- $blockname
- the blockname of the block to retrieve
- $parent_block
- the parent block in which $blockname will be searched for
Returns
mixed[] The requested block
|
public
boolean
|
#
is_true( string $value )
Tells whether a condition is true. Conditions are global boolean variables.
Tells whether a condition is true. Conditions are global boolean variables.
Parameters
- $value
- $varname the name of the variable to check if it is true
Returns
boolean true if the variable $varname exists and is not considered as false
|
public
string
|
#
get( string $varname )
Returns the $varname variable content searched in from the $list
Returns the $varname variable content searched in from the $list
Parameters
- $varname
- the name of the variable to retrieve
Returns
string the $varname variable content
|
public
string
|
#
get_from_list( string $varname, mixed[] & $list )
Similar from the get_var method but it works with loop variables instead of global variables.
Similar from the get_var method but it works with loop variables instead of global variables.
Parameters
- $varname
- The name of the variable to retrieve
- $list
- The list into which retrieve the variable
Returns
string The variable content
|
public
|
|