, , , Twig , FormView \ArrayAccess . , parent vars, , .
Twig, . , FormView:
public function getFunctions()
{
return array(
new TwigFunction('formview_prop', array($this, 'getFormViewProperty')),
);
}
public function getFormViewProperty(FormView $formView, string $prop)
{
return $formView->{$prop};
}
, , ( ):
{% for child in formview_prop(form, 'parent') %}
( ) . , formview_parent, formview_children formview_vars .
, , Symfony 2.7.39, 2.8.32, 3.3.14, 3.4.1, 4.0.1 ( ) Twig rootform, , parent:
{% if form is rootform %}