diff options
author | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-06-29 11:07:10 -0500 |
---|---|---|
committer | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-06-29 11:07:10 -0500 |
commit | 64963b5962d9a4bf1888dd1642a32ba3f6037258 (patch) | |
tree | 005b45fe8b8aab32e69ca3a7e951fc25bf70837d /phpBB/includes/template/twig/definition.php | |
parent | abb7901edb61e551b5783254579fef737f6f5c37 (diff) | |
download | forums-64963b5962d9a4bf1888dd1642a32ba3f6037258.tar forums-64963b5962d9a4bf1888dd1642a32ba3f6037258.tar.gz forums-64963b5962d9a4bf1888dd1642a32ba3f6037258.tar.bz2 forums-64963b5962d9a4bf1888dd1642a32ba3f6037258.tar.xz forums-64963b5962d9a4bf1888dd1642a32ba3f6037258.zip |
[feature/twig] Fixing DEFINE statements
PHPBB3-11598
Diffstat (limited to 'phpBB/includes/template/twig/definition.php')
-rw-r--r-- | phpBB/includes/template/twig/definition.php | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/phpBB/includes/template/twig/definition.php b/phpBB/includes/template/twig/definition.php new file mode 100644 index 0000000000..110437eb32 --- /dev/null +++ b/phpBB/includes/template/twig/definition.php @@ -0,0 +1,50 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2013 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* This class holds all DEFINE variables from the current page load +*/ +class phpbb_template_twig_definition +{ + /** @var array **/ + protected $definitions = array(); + + /** + * Get a DEFINE'd variable + * + * @param string $name + * @return mixed Null if not found + */ + public function __call($name, $arguments) + { + return (isset($this->definitions[$name])) ? $this->definitions[$name] : null; + } + + /** + * DEFINE a variable + * + * @param string $name + * @param mixed $value + * @return phpbb_template_twig_definition + */ + public function set($name, $value) + { + $this->definitions[$name] = $value; + + return $this; + } +} |