Tple_Exports __construct(
)
|
|
Constructor
void add_pair(
string
$var_name, mixed
$value
)
|
|
Adds new variable and value
Will throw TE_Var_Already_Exists if variable with same name already exists
Parameters:
|
string |
$var_name: |
Variable name |
|
mixed |
$value: |
Variable value |
API Tags:
Information Tags:
| Throws: | TE_Var_Already_Exists |
Returns all variable-value pairs
API Tags:
mixed get_pair_value(
string
$key, [boolean
$forgiving = true]
)
|
|
Gets value of pair
If $forgiving is set to false will throw exception TE_Key_Not_Exists if such key does not exist. If $forgiving is set to true will return NULL if such key does not exist.
Parameters:
|
string |
$key: |
|
|
boolean |
$forgiving: |
|
API Tags:
Information Tags:
| Throws: | TE_Key_Not_Exists |
boolean key_exists(
string
$key
)
|
|
Checks if there is already added pair with key $key
Parameters:
API Tags:
Merges variables of current TPLE_Exports with those provided by $exports
Parameters:
API Tags:
void update_pair_value(
string
$var_name, mixed
$value
)
|
|
Changes value for pair
Please note that if you need this function it is indicator that there is something wrong with your code - it is not normal to add variable and later to need to change its value. Design your code in a way that exports (add_pair()) are added just before parsing the template
Parameters:
|
string |
$var_name: |
Variable name |
|
mixed |
$value: |
Variable value |
API Tags: