FormExtension::isSelectedChoice()

bool isSelectedChoice(ChoiceView $choice, string|array $selectedValue) Returns whether a choice is selected for a given form value. Unfortunately Twig does not support an efficient way to execute the "is_selected" closure passed to the template by ChoiceType. It is faster to implement the logic here (around 65ms for a specific form). Directly implementing the logic here is also faster than doing so in ChoiceView (around 30ms). The worst option tested so far is to implement the lo

FormExtension::initRuntime()

initRuntime(Twig_Environment $environment) {@inheritdoc} Parameters Twig_Environment $environment

FormExtension::humanize()

string humanize(string $text) Makes a technical name human readable. Parameters string $text The text to humanize Return Value string The humanized text

FormExtension::getTokenParsers()

getTokenParsers() {@inheritdoc}

FormExtension::getTests()

getTests() {@inheritdoc}

FormExtension::getName()

getName() {@inheritdoc}

FormExtension::getFunctions()

getFunctions() {@inheritdoc}

FormExtension::getFilters()

getFilters() {@inheritdoc}

FormExtension

class FormExtension extends Twig_Extension implements Twig_Extension_InitRuntimeInterface FormExtension extends Twig with form capabilities. Properties TwigRendererInterface $renderer This property is public so that it can be accessed directly from compiled templates without having to call a getter, which slightly decreases performance. Methods __construct(TwigRendererInterface $renderer) initRuntime(Twig_Environment $environment) {@inheritdoc} getTokenParsers() {@inherit

FormEvents

class FormEvents To learn more about how form events work check the documentation entry at {@link https://symfony.com/doc/any/components/form/form_events.html}. To learn how to dynamically modify forms using events check the cookbook entry at {@link https://symfony.com/doc/any/cookbook/form/dynamicformmodification.html}. Constants PRE_SUBMIT The PRE_SUBMIT event is dispatched at the beginning of the Form::submit() method. It can be used to: - Change data from the request, before submitting