diff options
| author | Vjacheslav Trushkin <arty@phpbb.com> | 2012-03-05 02:41:42 +0200 |
|---|---|---|
| committer | Vjacheslav Trushkin <arty@phpbb.com> | 2012-03-05 02:41:42 +0200 |
| commit | a98117b22967db2c475988a0b271d827cf0f9af6 (patch) | |
| tree | 40e6b41b5d8ccb2755252d399d03056faa83ddb2 /phpBB/includes/template/context.php | |
| parent | d6a6d63a9eee208fdfafed1441f19076a8f6d2e1 (diff) | |
| download | forums-a98117b22967db2c475988a0b271d827cf0f9af6.tar forums-a98117b22967db2c475988a0b271d827cf0f9af6.tar.gz forums-a98117b22967db2c475988a0b271d827cf0f9af6.tar.bz2 forums-a98117b22967db2c475988a0b271d827cf0f9af6.tar.xz forums-a98117b22967db2c475988a0b271d827cf0f9af6.zip | |
[feature/append_var] Adding append_var template class function
Adding append_var template class function
PHPBB3-10666
Diffstat (limited to 'phpBB/includes/template/context.php')
| -rw-r--r-- | phpBB/includes/template/context.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/phpBB/includes/template/context.php b/phpBB/includes/template/context.php index 65a3531bc5..ec09da1cf3 100644 --- a/phpBB/includes/template/context.php +++ b/phpBB/includes/template/context.php @@ -53,7 +53,9 @@ class phpbb_template_context } /** - * Assign a single variable to a single key + * Assign a single scalar value to a single key. + * + * Value can be a string, an integer or a boolean. * * @param string $varname Variable name * @param string $varval Value to assign to variable @@ -66,6 +68,21 @@ class phpbb_template_context } /** + * Append text to the string value stored in a key. + * + * Text is appended using the string concatenation operator (.). + * + * @param string $varname Variable name + * @param string $varval Value to append to variable + */ + public function append_var($varname, $varval) + { + $this->rootref[$varname] = (isset($this->rootref[$varname]) ? $this->rootref[$varname] : '') . $varval; + + return true; + } + + /** * Returns a reference to template data array. * * This function is public so that template renderer may invoke it. |
