moved method to function
This commit is contained in:
parent
0829b79c6d
commit
93e136b306
@ -106,7 +106,7 @@ class FormExtension extends AbstractExtension implements InitRuntimeInterface
|
|||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
new TwigTest('selectedchoice', 'Symfony\Bridge\Twig\Extension\twig_is_selected_choice'),
|
new TwigTest('selectedchoice', 'Symfony\Bridge\Twig\Extension\twig_is_selected_choice'),
|
||||||
new TwigTest('rootform', array($this, 'isRootForm')),
|
new TwigTest('rootform', 'Symfony\Bridge\Twig\Extension\twig_is_root_form'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,14 +166,6 @@ class FormExtension extends AbstractExtension implements InitRuntimeInterface
|
|||||||
unset($this->$name);
|
unset($this->$name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @internal
|
|
||||||
*/
|
|
||||||
public function isRootForm(FormView $formView)
|
|
||||||
{
|
|
||||||
return null === $formView->parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
@ -202,3 +194,11 @@ function twig_is_selected_choice(ChoiceView $choice, $selectedValue)
|
|||||||
|
|
||||||
return $choice->value === $selectedValue;
|
return $choice->value === $selectedValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
function twig_is_root_form(FormView $formView)
|
||||||
|
{
|
||||||
|
return null === $formView->parent;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user