protected function Twig_TokenParser_Include::parseArguments in Translation template extractor 6.3
Same name and namespace in other branches
- 7.3 vendor/Twig/TokenParser/Include.php \Twig_TokenParser_Include::parseArguments()
2 calls to Twig_TokenParser_Include::parseArguments()
- Twig_TokenParser_Embed::parse in vendor/
Twig/ TokenParser/ Embed.php - Parses a token and returns a node.
- Twig_TokenParser_Include::parse in vendor/
Twig/ TokenParser/ Include.php - Parses a token and returns a node.
File
- vendor/
Twig/ TokenParser/ Include.php, line 40
Class
- Twig_TokenParser_Include
- Includes a template.
Code
protected function parseArguments() {
$stream = $this->parser
->getStream();
$ignoreMissing = false;
if ($stream
->nextIf(Twig_Token::NAME_TYPE, 'ignore')) {
$stream
->expect(Twig_Token::NAME_TYPE, 'missing');
$ignoreMissing = true;
}
$variables = null;
if ($stream
->nextIf(Twig_Token::NAME_TYPE, 'with')) {
$variables = $this->parser
->getExpressionParser()
->parseExpression();
}
$only = false;
if ($stream
->nextIf(Twig_Token::NAME_TYPE, 'only')) {
$only = true;
}
$stream
->expect(Twig_Token::BLOCK_END_TYPE);
return array(
$variables,
$only,
$ignoreMissing,
);
}