Add UIBlocks to twig (changed UIContentBlock params)

This commit is contained in:
Eric
2021-01-14 09:29:12 +01:00
parent bffb7b5eab
commit e51fd028fa
5 changed files with 95 additions and 19 deletions

View File

@@ -22,20 +22,14 @@ class UIContentBlockParser extends AbstractTokenParser
$iLineno = $token->getLine();
$oStream = $this->parser->getStream();
$sName = null;
if ($oStream->test(Token::STRING_TYPE)) {
$sName = $oStream->expect(Token::STRING_TYPE)->getValue();
}
$sContainerClass = '';
if ($oStream->test(Token::STRING_TYPE)) {
$sContainerClass = $oStream->expect(Token::STRING_TYPE)->getValue();
}
$oParams = $this->parser->getExpressionParser()->parseExpression();
$oStream->expect(Token::BLOCK_END_TYPE);
$oBody = $this->parser->subparse([$this, 'decideForEnd'], true);
$oStream->expect(Token::BLOCK_END_TYPE);
return new UIContentBlockNode($sName, $sContainerClass, $oBody, $iLineno, $this->getTag());
return new UIContentBlockNode($oParams, $oBody, $iLineno, $this->getTag());
}
/**