diff options
| author | Oleg Pudeyev <oleg@bsdpower.com> | 2011-05-07 15:10:50 -0400 |
|---|---|---|
| committer | Oleg Pudeyev <oleg@bsdpower.com> | 2011-05-07 17:47:02 -0400 |
| commit | 0501640d5db158a010741e27803191ab469834c4 (patch) | |
| tree | aef714b410a540c3c9572753aa6874676c4df29a /phpBB/includes/template_executor_eval.php | |
| parent | d8122df3329214f8710c8af3c0ce1ed86505e810 (diff) | |
| download | forums-0501640d5db158a010741e27803191ab469834c4.tar forums-0501640d5db158a010741e27803191ab469834c4.tar.gz forums-0501640d5db158a010741e27803191ab469834c4.tar.bz2 forums-0501640d5db158a010741e27803191ab469834c4.tar.xz forums-0501640d5db158a010741e27803191ab469834c4.zip | |
[feature/template-engine] Added phpbb_template_context class.
Objects of this class hold variables assigned to templates.
PHPBB3-9726
Diffstat (limited to 'phpBB/includes/template_executor_eval.php')
| -rw-r--r-- | phpBB/includes/template_executor_eval.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/phpBB/includes/template_executor_eval.php b/phpBB/includes/template_executor_eval.php index 27bdf95b52..af7d68fef3 100644 --- a/phpBB/includes/template_executor_eval.php +++ b/phpBB/includes/template_executor_eval.php @@ -13,20 +13,30 @@ class phpbb_template_executor_eval implements phpbb_template_executor /** * Constructor. Stores provided code for future evaluation. + * Template includes are delegated to template object $template. * * @param string $code php code of the template + * @param phpbb_template $template template object */ - public function __construct($code) + public function __construct($code, $template) { $this->code = $code; + $this->template = $template; } /** * Executes the template managed by this executor by eval'ing php code * of the template. + * @param phpbb_template_context $context Template context to use + * @param array $lang Language entries to use */ - public function execute() + public function execute($context, $lang) { + $_template = &$this->template; + $_tpldata = &$context->get_data_ref(); + $_rootref = &$context->get_root_ref(); + $_lang = &$lang; + eval($this->code); } } |
