mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
Add parent reference to Template instances
This commit is contained in:
parent
4054dec926
commit
a5d6a76cf4
3 changed files with 57 additions and 18 deletions
|
|
@ -407,7 +407,7 @@ class TemplateParser_v2
|
|||
|
||||
// Generate the code to create a new Template object and compile it.
|
||||
$tpl = '<?php $__tpl = new \Rhymix\Framework\Template(' . $dir . ', "' . $path . '", "' . ($this->template->extension ?: 'auto') . '"); ';
|
||||
$tpl .= 'if ($this->vars): $__tpl->setVars($this->vars); endif; ';
|
||||
$tpl .= '$__tpl->setParent($this); if ($this->vars): $__tpl->setVars($this->vars); endif; ';
|
||||
$tpl .= !empty($attrs['vars']) ? '$__tpl->addVars(' . self::_convertVariableScope($attrs['vars']) . '); ' : '';
|
||||
$tpl .= 'echo $__tpl->compile(); ?>';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue