[feature/template-engine] Fixed reference usage.

Hopefully this is right, I have not checked it against the manual
(assuming the manual even covers these things).

PHPBB3-9726
This commit is contained in:
Oleg Pudeyev 2011-05-11 09:12:52 -04:00
parent 169c4377e9
commit 635460fa6d
3 changed files with 7 additions and 3 deletions

View file

@ -68,11 +68,15 @@ class phpbb_template_context
public function get_data_ref()
{
return $this->tpldata;
// returning a reference directly is not
// something php is capable of doing
$ref = &$this->tpldata;
return $ref;
}
public function get_root_ref()
{
// rootref is already a reference
return $this->rootref;
}

View file

@ -50,7 +50,7 @@ class phpbb_template_renderer_eval implements phpbb_template_renderer
*/
public function render($context, $lang)
{
$_template = &$this->template;
$_template = $this->template;
$_tpldata = &$context->get_data_ref();
$_rootref = &$context->get_root_ref();
$_lang = &$lang;

View file

@ -50,7 +50,7 @@ class phpbb_template_renderer_include implements phpbb_template_renderer
*/
public function render($context, $lang)
{
$_template = &$this->template;
$_template = $this->template;
$_tpldata = &$context->get_data_ref();
$_rootref = &$context->get_root_ref();
$_lang = &$lang;