Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
453 changes: 453 additions & 0 deletions book/zend.form.advanced-use-of-forms.md

Large diffs are not rendered by default.

804 changes: 804 additions & 0 deletions book/zend.form.collections.md

Large diffs are not rendered by default.

1,488 changes: 1,488 additions & 0 deletions book/zend.form.elements.md

Large diffs are not rendered by default.

657 changes: 657 additions & 0 deletions book/zend.form.file-upload.md

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions book/zend.form.intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Introduction

`Zend\Form` is intended primarily as a bridge between your domain models and the View Layer. It
composes a thin layer of objects representing form elements, an \[InputFilter\](zend.input-filter),
and a small number of methods for binding data to and from the form and attached objects.

The `Zend\Form` component consists of the following objects:

- `Elements`, which simply consist of a name and attributes.
- `Fieldsets`, which extend from `Elements`, but allow composing other fieldsets and elements.
- `Forms`, which extend from `Fieldsets` (and thus `Elements`). They provide data and object
binding, and compose \[InputFilters\](zend.input-filter.intro). Data binding is done via
\[Zend\\Stdlib\\Hydrator\](zend.stdlib.hydrator).

To facilitate usage with the view layer, the `Zend\Form` component also aggregates a number of
form-specific view helpers. These accept elements, fieldsets, and/or forms, and use the attributes
they compose to render markup.

A small number of specialized elements are provided for accomplishing application-centric tasks.
These include the `Csrf` element, used to prevent Cross Site Request Forgery attacks, and the
`Captcha` element, used to display and validate \[CAPTCHAs\](zend.captcha).

A `Factory` is provided to facilitate creation of elements, fieldsets, forms, and the related input
filter. The default `Form` implementation is backed by a factory to facilitate extension and ease
the process of form creation.

The code related to forms can often spread between a variety of concerns: a form definition, an
input filter definition, a domain model class, and one or more hydrator implementations. As such,
finding the various bits of code and how they relate can become tedious. To simplify the situation,
you can also annotate your domain model class, detailing the various input filter definitions,
attributes, and hydrators that should all be used together. `Zend\Form\Annotation\AnnotationBuilder`
can then be used to build the various objects you need.
Loading