ChoiceAttr example

return new ChoiceFieldName($formType$fieldName$vary);
    }

    /** * Decorates a "choice_attr" option to make it cacheable. * * @param callable|array $attr Any pseudo callable or array to create html attributes from a choice * @param mixed $vary Dynamic data used to compute a unique hash when caching the option */
    public static function attr(FormTypeInterface|FormTypeExtensionInterface $formType, callable|array $attr, mixed $vary = null): ChoiceAttr
    {
        return new ChoiceAttr($formType$attr$vary);
    }

    /** * Decorates a "choice_translation_parameters" option to make it cacheable. * * @param callable|array $translationParameters Any pseudo callable or array to create translation parameters from a choice * @param mixed $vary Dynamic data used to compute a unique hash when caching the option */
    public static function translationParameters(FormTypeInterface|FormTypeExtensionInterface $formType, callable|array $translationParameters, mixed $vary = null): ChoiceTranslationParameters
    {
        return new ChoiceTranslationParameters($formType$translationParameters$vary);
    }
Home | Imprint | This part of the site doesn't use cookies.