Class: \Conifer\Twig\FormHelper
Twig Wrapper for helpful linguistic filters, such as pluralize
Visibility | Function |
---|---|
public | checked_attr(\Conifer\Twig\Form/\Conifer\Form\AbstractBase $form, \string $fieldName, \string $value=null)</strong> : string literally " checked " if the field (optionally the one matching $value ) was checked, or the empty stringReturn the checked attribute for a given form input, given the (hydrated) form and the field name, and optionally the value to check against. necessary e.g. for radio inputs, where there's more than one possible value. |
public | get_error_messages_for(\Conifer\Twig\Form/\Conifer\Form\AbstractBase $form, \string $fieldName, \string $separator='<br>' )</strong> : stringGet the error messages for a specific field only, as a concatenated string with line breaks between by default |
public | get_field_class(\Conifer\Form\AbstractBase $form, \string $fieldName, \string $errorClass='error' )</strong> : string the HTML class(es) to renderGet the class to render for the form field, based on its error state |
public | get_filters() : array an associative array of callback functions, keyed by name Get the Twig functions to register |
public | get_functions() : array Does not supply any additional Twig functions. |
public | selected_attr(\Conifer\Twig\Form/\Conifer\Form\AbstractBase $form, \string $fieldName, \string $value)</strong> : string literally " selected " if the field (optionally the one matching $value ) was selected, or the empty stringReturn the selected attribute for a given form input, given the (hydrated) form and the field name, and optionally the value to check against. necessary e.g. for radio inputs, where there's more than one possible value. |
This class implements \Conifer\Twig\HelperInterface