This Page

Zend\Form

Zend Framework comes with an initial set of helper classes related to Forms:
e.g., rendering a text input, selection box, or form labels.
You can use helper, or plugin, classes to perform these behaviors for you.

useZend\Captcha;useZend\Form\Element;$captcha=newElement\Captcha('captcha');$captcha->setCaptcha(newCaptcha\Dumb())->setLabel('Please verify you are human');// Within your view...echo$this->formCaptcha($captcha);// TODO

The FormCheckbox view helper can be used to render a <inputtype="checkbox"> HTML
form input. It is meant to work with the Zend\Form\Element\Checkbox
element, which provides a default input specification for validating the checkbox values.

The FormElement view helper proxies the rendering to specific form view helpers
depending on the type of the Zend\Form\Element that is passed in. For instance,
if the passed in element had a type of “text”, the FormElement helper will retrieve
and use the FormText helper to render the element.

The FormInput view helper is used to render a <input> HTML form input tag.
It acts as a base class for all of the specifically typed form input helpers
(FormText, FormCheckbox, FormSubmit, etc.), and is not suggested for direct use.

It contains a general map of valid tag attributes and types for attribute filtering.
Each subclass of FormInput implements it’s own specific map of valid tag attributes.

The FormLabel view helper is used to render a <label> HTML element and its attributes.
If you have a Zend\I18n\Translator\Translator attached, FormLabel will translate
the label contents during it’s rendering.

Note: If you have a translator in the Service Manager under the key, ‘translator’, the view helper plugin
manager will automatically attach the translator to the FormLabel view helper. See
Zend\\View\\HelperPluginManager::injectTranslator() for more information.

The FormMultiCheckbox view helper can be used to render a group <inputtype="checkbox"> HTML
form inputs. It is meant to work with the Zend\Form\Element\MultiCheckbox
element, which provides a default input specification for validating a multi checkbox.

The FormRadio view helper can be used to render a group <inputtype="radio"> HTML
form inputs. It is meant to work with the Zend\Form\Element\Radio
element, which provides a default input specification for validating a radio.

The FormSelect view helper can be used to render a group <inputtype="select"> HTML
form input. It is meant to work with the Zend\Form\Element\Select
element, which provides a default input specification for validating a select.

The AbstractHelper is used as a base abstract class for Form view helpers, providing methods
for validating form HTML attributes, as well as controlling the doctype and character encoding.
AbstractHelper also extends from Zend\I18n\View\Helper\AbstractTranslatorHelper which
provides an implementation for the Zend\I18n\Translator\TranslatorAwareInterface
that allows setting a translator and text domain.

The FormColor view helper can be used to render a <inputtype="color"> HTML5 form input.
It is meant to work with the Zend\Form\Element\Color
element, which provides a default input specification for validating HTML5 color values.

The FormDate view helper can be used to render a <inputtype="date">
HTML5 form input. It is meant to work with the Zend\Form\Element\Date
element, which provides a default input specification for validating HTML5 date values.

The FormDateTime view helper can be used to render a <inputtype="datetime">
HTML5 form input. It is meant to work with the Zend\Form\Element\DateTime
element, which provides a default input specification for validating HTML5 datetime values.

The FormDateTimeLocal view helper can be used to render a <inputtype="datetime-local">
HTML5 form input. It is meant to work with the Zend\Form\Element\DateTimeLocal
element, which provides a default input specification for validating HTML5 datetime values.

The FormEmail view helper can be used to render a <inputtype="email">
HTML5 form input. It is meant to work with the Zend\Form\Element\Email
element, which provides a default input specification with an email validator.

The FormMonth view helper can be used to render a <inputtype="month">
HTML5 form input. It is meant to work with the Zend\Form\Element\Month
element, which provides a default input specification for validating HTML5 date values.

The FormTime view helper can be used to render a <inputtype="time">
HTML5 form input. It is meant to work with the Zend\Form\Element\Time
element, which provides a default input specification for validating HTML5 time values.

The FormWeek view helper can be used to render a <inputtype="week">
HTML5 form input. It is meant to work with the Zend\Form\Element\Week
element, which provides a default input specification for validating HTML5 week values.

The FormFileApcProgress view helper can be used to render a <inputtype="hidden"...> with
a progress ID value used by the APC File Upload Progress feature. The APC php module is required for this
view helper to work. Unlike other Form view helpers, the FormFileSessionProgress helper does not accept a
Form Element as a parameter.

An id attribute with a value of "progress_key" will automatically be added.

Warning

The view helper must be rendered before the file input in the form,
or upload progress will not work correctly.

The FormFileSessionProgress view helper can be used to render a <inputtype="hidden"...> which can be used by
the PHP 5.4 File Upload Session Progress feature. PHP 5.4 is required for this view helper to work. Unlike
other Form view helpers, the FormFileSessionProgress helper does not accept a Form Element as a parameter.

An id attribute with a value of "progress_key" will automatically be added.

Warning

The view helper must be rendered before the file input in the form,
or upload progress will not work correctly.

The FormFileUploadProgress view helper can be used to render a <inputtype="hidden"...> which can be used by
the PECL uploadprogress extension. Unlike other Form view helpers, the FormFileUploadProgress helper does not
accept a Form Element as a parameter.

An id attribute with a value of "progress_key" will automatically be added.

Warning

The view helper must be rendered before the file input in the form,
or upload progress will not work correctly.