diff options
| author | Nathan Guse <nathaniel.guse@gmail.com> | 2013-06-24 12:39:28 -0500 |
|---|---|---|
| committer | Nathan Guse <nathaniel.guse@gmail.com> | 2013-06-24 12:39:28 -0500 |
| commit | c958155fb63667e1d54d6d31489bf17c0a180dab (patch) | |
| tree | 05c535c0c7c35f8410f4b3414295ed97cec79aa1 /phpBB/includes/template/twig/tokenparser/include.php | |
| parent | 4881085f13f0b10636bf11f846f86562c1e6bfc9 (diff) | |
| download | forums-c958155fb63667e1d54d6d31489bf17c0a180dab.tar forums-c958155fb63667e1d54d6d31489bf17c0a180dab.tar.gz forums-c958155fb63667e1d54d6d31489bf17c0a180dab.tar.bz2 forums-c958155fb63667e1d54d6d31489bf17c0a180dab.tar.xz forums-c958155fb63667e1d54d6d31489bf17c0a180dab.zip | |
[feature/twig] Able to set chain of namespaces to search for loadTemplate()
This is done so that when event template files are included, if they
include files themselves, that namespace is checked first, then __main__
is checked to include the correct template file.
Also, when template files are included from a particular namespace, this is
done so that the files from that namespace are included first, then the
main namespace is checked.
We may want to change this behavior in the future to allow choosing which
locations have priority, but for now, this is what I am doing to make sure
the behavior is simple and always the same.
PHPBB3-11598
Diffstat (limited to 'phpBB/includes/template/twig/tokenparser/include.php')
| -rw-r--r-- | phpBB/includes/template/twig/tokenparser/include.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/phpBB/includes/template/twig/tokenparser/include.php b/phpBB/includes/template/twig/tokenparser/include.php index d9421095d1..32e1cd331d 100644 --- a/phpBB/includes/template/twig/tokenparser/include.php +++ b/phpBB/includes/template/twig/tokenparser/include.php @@ -22,6 +22,22 @@ class phpbb_template_twig_tokenparser_include extends Twig_TokenParser_Include { /** + * Parses a token and returns a node. + * + * @param Twig_Token $token A Twig_Token instance + * + * @return Twig_NodeInterface A Twig_NodeInterface instance + */ + public function parse(Twig_Token $token) + { + $expr = $this->parser->getExpressionParser()->parseExpression(); + + list($variables, $only, $ignoreMissing) = $this->parseArguments(); + + return new phpbb_template_twig_node_include($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag()); + } + + /** * Gets the tag name associated with this token parser. * * @return string The tag name |
