Augmentation vers version 3.3.0
This commit is contained in:
@@ -24,11 +24,10 @@ class SearchAndRenderBlockNode extends FunctionExpression
|
||||
public function compile(Compiler $compiler)
|
||||
{
|
||||
$compiler->addDebugInfo($this);
|
||||
$compiler->raw('$this->env->getExtension(\'Symfony\Bridge\Twig\Extension\FormExtension\')->renderer->searchAndRenderBlock(');
|
||||
$compiler->raw('$this->env->getRuntime(\'Symfony\Component\Form\FormRenderer\')->searchAndRenderBlock(');
|
||||
|
||||
preg_match('/_([^_]+)$/', $this->getAttribute('name'), $matches);
|
||||
|
||||
$label = null;
|
||||
$arguments = iterator_to_array($this->getNode('arguments'));
|
||||
$blockNameSuffix = $matches[1];
|
||||
|
||||
@@ -53,7 +52,7 @@ class SearchAndRenderBlockNode extends FunctionExpression
|
||||
// Only insert the label into the array if it is not empty
|
||||
if (!twig_test_empty($label->getAttribute('value'))) {
|
||||
$originalVariables = $variables;
|
||||
$variables = new ArrayExpression(array(), $lineno);
|
||||
$variables = new ArrayExpression([], $lineno);
|
||||
$labelKey = new ConstantExpression('label', $lineno);
|
||||
|
||||
if (null !== $originalVariables) {
|
||||
@@ -100,7 +99,7 @@ class SearchAndRenderBlockNode extends FunctionExpression
|
||||
// If not, add it to the array at runtime.
|
||||
$compiler->raw('(twig_test_empty($_label_ = ');
|
||||
$compiler->subcompile($label);
|
||||
$compiler->raw(') ? array() : array("label" => $_label_))');
|
||||
$compiler->raw(') ? [] : ["label" => $_label_])');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user