mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-16 00:08:53 +00:00
45 lines
848 B
PHP
45 lines
848 B
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of Twig.
|
|
*
|
|
* (c) 2009 Fabien Potencier
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
/**
|
|
* Defines a variable.
|
|
*
|
|
* <pre>
|
|
* {% set foo = 'foo' %}
|
|
*
|
|
* {% set foo = [1, 2] %}
|
|
*
|
|
* {% set foo = {'foo': 'bar'} %}
|
|
*
|
|
* {% set foo = 'foo' ~ 'bar' %}
|
|
*
|
|
* {% set foo, bar = 'foo', 'bar' %}
|
|
*
|
|
* {% set foo %}Some content{% endset %}
|
|
* </pre>
|
|
*/
|
|
class phpbb_template_twig_tokenparser_define extends Twig_TokenParser_Set
|
|
{
|
|
public function decideBlockEnd(Twig_Token $token)
|
|
{
|
|
return $token->test('ENDDEFINE');
|
|
}
|
|
|
|
/**
|
|
* Gets the tag name associated with this token parser.
|
|
*
|
|
* @return string The tag name
|
|
*/
|
|
public function getTag()
|
|
{
|
|
return 'DEFINE';
|
|
}
|
|
}
|