Difference between revisions of "Template.assign var"
From phpBB Development Wiki
Revision as of 21:59, 21 September 2008
template::assign_var –– Assign a single variable to a single key to the template object.
bool template::assign_var ( string $varname , mixed $varval )
This method is identical to the template::assign_vars method, except that this method assigns only a single variable to a single key.
- Note: When assigning more than a single template variable in a file, it is preferred to use the template::assign_vars method. As a general rule, template::assign_var should only be used if a single template variable needs to be assigned from within a function or the entire file.
|varname||Key to assign to the template.|
|varval||Variable assigned to the key|
Variable assigned to the template object in your PHP file. (PHP Controller file)
Example of usage of this variable within the HTML template: