Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Fix bullet list in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Lechevalier committed Jan 23, 2016
1 parent 9fcbb72 commit 51570c9
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 59 deletions.
20 changes: 10 additions & 10 deletions book/zend.form.collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,14 +419,14 @@ entity.

This element has a few interesting options:

- `count`: this is how many times the element (in this case a category) has to be rendered. We've
* `count`: this is how many times the element (in this case a category) has to be rendered. We've
set it to two in this examples.
- `should_create_template`: if set to `true`, it will generate a template markup in a `<span>`
* `should_create_template`: if set to `true`, it will generate a template markup in a `<span>`
element, in order to simplify adding new element on the fly (we will speak about this one later).
- `allow_add`: if set to `true` (which is the default), dynamically added elements will be retrieved
* `allow_add`: if set to `true` (which is the default), dynamically added elements will be retrieved
and validated; otherwise, they will be completely ignored. This, of course, depends on what you want
to do.
- `target_element`: this is either an element or, as this is the case in this example, an array that
* `target_element`: this is either an element or, as this is the case in this example, an array that
describes the element or fieldset that will be used in the collection. In this case, the
`target_element` is a `Category` fieldset.

Expand Down Expand Up @@ -550,10 +550,10 @@ echo $this->form()->closeTag();

A few new things here :

- the `prepare()` method. You *must* call it prior to rendering anything in the view (this function
* the `prepare()` method. You *must* call it prior to rendering anything in the view (this function
is only meant to be called in views, not in controllers).
- the `FormRow` helper renders a label (if present), the input itself, and errors.
- the `FormCollection` helper will iterate through every element in the collection, and render every
* the `FormRow` helper renders a label (if present), the input itself, and errors.
* the `FormCollection` helper will iterate through every element in the collection, and render every
element with the FormRow helper (you may specify an alternate helper if desired, using the
`setElementHelper()` method on that `FormCollection` helper instance). If you need more control
about the way you render your forms, you can iterate through the elements in the collection, and
Expand Down Expand Up @@ -629,7 +629,7 @@ The `add_category` function is fairly simple:

Here is the code:

```php
```javascript
<script>
function add_category() {
var currentCount = $('form > fieldset > fieldset').length;
Expand Down Expand Up @@ -678,11 +678,11 @@ $this->add(array(

There are some limitations to this capability:

- Although you can add new elements and remove them, you *CANNOT* remove more elements in a
* Although you can add new elements and remove them, you *CANNOT* remove more elements in a
collection than the initial count (for instance, if your code specifies `count == 2`, you will be
able to add a third one and remove it, but you won't be able to remove any others. If the initial
count is 2, you *must* have at least two elements.
- Dynamically added elements have to be added at the end of the collection. They can be added
* Dynamically added elements have to be added at the end of the collection. They can be added
anywhere (these elements will still be validated and inserted into the entity), but if the
validation fails, this newly added element will be automatically be replaced at the end of the
collection.
Expand Down
12 changes: 6 additions & 6 deletions book/zend.form.elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,13 +498,13 @@ $form->add(array(
In order to set attributes or customize the option elements, an array can be used instead of a
string. The following keys are supported:

- `"label"` - The string displayed for the option.
- `"value"` - The form value associated with the option.
- `"selected"` - Boolean that sets whether the option is marked as selected.
- `"disabled"` - Boolean that sets whether the option will be disabled
- `"attributes"` - Array of html attributes that will be set on this option. Merged with the
* `"label"` - The string displayed for the option.
* `"value"` - The form value associated with the option.
* `"selected"` - Boolean that sets whether the option is marked as selected.
* `"disabled"` - Boolean that sets whether the option will be disabled
* `"attributes"` - Array of html attributes that will be set on this option. Merged with the
attributes set on the element.
- `"label_attributes"` - Array of html attributes that will be set on the label. Merged with the
* `"label_attributes"` - Array of html attributes that will be set on the label. Merged with the
attributes set on the element's label.

```php
Expand Down
36 changes: 18 additions & 18 deletions book/zend.form.file-upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ processing, but with some slight caveats that will be described below.

In this example we will:

- Define a **Form** for backend validation and filtering.
- Create a **view template** with a `<form>` containing a file input.
- Process the form within a **Controller action**.
* Define a **Form** for backend validation and filtering.
* Create a **view template** with a `<form>` containing a file input.
* Process the form within a **Controller action**.

### The Form and InputFilter

Expand Down Expand Up @@ -58,11 +58,11 @@ class UploadForm extends Form

The `File` element provides some automatic features that happen behind the scenes:

- The form's `enctype` will automatically be set to `multipart/form-data` when the form `prepare()`
* The form's `enctype` will automatically be set to `multipart/form-data` when the form `prepare()`
method is called.
- The file element's default input specification will create the correct `Input` type:
* The file element's default input specification will create the correct `Input` type:
\[Zend\\InputFilter\\FileInput\](zend.input-filter.file-input).
- The `FileInput` will automatically prepend an \[UploadFile
* The `FileInput` will automatically prepend an \[UploadFile
Validator\](zend.validator.file.upload-file), to securely validate that the file is actually an
uploaded file, and to report other types of upload errors to the user.

Expand Down Expand Up @@ -294,10 +294,10 @@ information on its supported options.

Behind the scenes, the `FilePRG` plugin will:

- Run the Form's filters, namely the `RenameUpload` filter, to move the files out of temporary
* Run the Form's filters, namely the `RenameUpload` filter, to move the files out of temporary
storage.
- Store the valid POST data in the session across requests.
- Change the `required` flag of any file inputs that had valid uploads to `false`. This is so that
* Store the valid POST data in the session across requests.
* Change the `required` flag of any file inputs that had valid uploads to `false`. This is so that
form re-submissions without uploads will not cause validation errors.

> ## Note
Expand Down Expand Up @@ -641,17 +641,17 @@ public function uploadFormAction()

Related documentation:

- \[Form File Element\](zend.form.element.file)
- \[Form File View Helper\](zend.form.view.helper.form-file)
- \[List of File Validators\](zend.validator.file)
- \[List of File Filters\](zend.filter.file)
- \[File Post-Redirect-Get Controller Plugin\](zend.mvc.controller-plugins.file-postredirectget)
- \[Zend\\InputFilter\\FileInput\](zend.input-filter.file-input)
- \[Upload Progress Handlers\](zend.progress-bar.upload)
- \[Upload Progress View Helpers\](zend.form.view.helper.file)
* \[Form File Element\](zend.form.element.file)
* \[Form File View Helper\](zend.form.view.helper.form-file)
* \[List of File Validators\](zend.validator.file)
* \[List of File Filters\](zend.filter.file)
* \[File Post-Redirect-Get Controller Plugin\](zend.mvc.controller-plugins.file-postredirectget)
* \[Zend\\InputFilter\\FileInput\](zend.input-filter.file-input)
* \[Upload Progress Handlers\](zend.progress-bar.upload)
* \[Upload Progress View Helpers\](zend.form.view.helper.file)

External resources and blog posts from the community:

- [ZF2FileUploadExamples](https://github.com/cgmartin/ZF2FileUploadExamples) : A ZF2 module with
* [ZF2FileUploadExamples](https://github.com/cgmartin/ZF2FileUploadExamples) : A ZF2 module with
several file upload examples.

6 changes: 3 additions & 3 deletions book/zend.form.intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ and a small number of methods for binding data to and from the form and attached

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
* `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).

Expand Down
44 changes: 22 additions & 22 deletions book/zend.form.quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ class SenderFieldset extends Fieldset implements InputFilterProviderInterface
),
'validators' => array(
array(
'name' => 'Zend\Validator\StringLength',
'name' => 'Zend\Validator\StringLength',
'options' => array(
'min' => 3,
'max' => 256
Expand Down Expand Up @@ -560,15 +560,15 @@ that in action.

When you `bind()` an object to the form, the following happens:

- The composed `Hydrator` calls `extract()` on the object, and uses the values returned, if any, to
* The composed `Hydrator` calls `extract()` on the object, and uses the values returned, if any, to
populate the `value` attributes of all elements. If a form contains a fieldset that itself contains
another fieldset, the form will recursively extract the values.
- When `isValid()` is called, if `setData()` has not been previously set, the form uses the composed
* When `isValid()` is called, if `setData()` has not been previously set, the form uses the composed
`Hydrator` to extract values from the object, and uses those during validation.
- If `isValid()` is successful (and the `bindOnValidate` flag is enabled, which is true by default),
* If `isValid()` is successful (and the `bindOnValidate` flag is enabled, which is true by default),
then the `Hydrator` will be passed the validated values to use to hydrate the bound object. (If you
do not want this behavior, call `setBindOnValidate(FormInterface::BIND_MANUAL)`).
- If the object implements `Zend\InputFilter\InputFilterAwareInterface`, the input filter it
* If the object implements `Zend\InputFilter\InputFilterAwareInterface`, the input filter it
composes will be used instead of the one composed on the form.

This is easier to understand in practice.
Expand Down Expand Up @@ -856,45 +856,45 @@ have a central place to define all of these?
Annotations allow us to solve this problem. You can define the following behaviors with the shipped
annotations in `Zend\Form`:

- *AllowEmpty*: mark an input as allowing an empty value. This annotation does not require a value.
- *Attributes*: specify the form, fieldset, or element attributes. This annotation requires an
* *AllowEmpty*: mark an input as allowing an empty value. This annotation does not require a value.
* *Attributes*: specify the form, fieldset, or element attributes. This annotation requires an
associative array of values, in a JSON object format:
`@Attributes({"class":"zend_form","type":"text"})`.
- *ComposedObject*: specify another object with annotations to parse. Typically, this is used if a
* *ComposedObject*: specify another object with annotations to parse. Typically, this is used if a
property references another object, which will then be added to your form as an additional fieldset.
Expects a string value indicating the class for the object being composed
`@ComposedObject("Namespace\Model\ComposedObject")` or an array to compose a collection:
`@ComposedObject({ "target_object":"Namespace\Model\ComposedCollection", "is_collection":"true",
"options":{"count":2}})` `target_object` is the element to compose, `is_collection` flags this as a
collection and `options` can take an array of options to pass into the collection.
- *ErrorMessage*: specify the error message to return for an element in the case of a failed
* *ErrorMessage*: specify the error message to return for an element in the case of a failed
validation. Expects a string value.
- *Exclude*: mark a property to exclude from the form or fieldset. This annotation does not require
* *Exclude*: mark a property to exclude from the form or fieldset. This annotation does not require
a value.
- *Filter*: provide a specification for a filter to use on a given element. Expects an associative
* *Filter*: provide a specification for a filter to use on a given element. Expects an associative
array of values, with a "name" key pointing to a string filter name, and an "options" key pointing
to an associative array of filter options for the constructor: `@Filter({"name": "Boolean",
"options": {"casting":true}})`. This annotation may be specified multiple times.
- *Flags*: flags to pass to the fieldset or form composing an element or fieldset; these are usually
* *Flags*: flags to pass to the fieldset or form composing an element or fieldset; these are usually
used to specify the name or priority. The annotation expects an associative array:
`@Flags({"priority": 100})`.
- *Hydrator*: specify the hydrator class to use for this given form or fieldset. A string value is
* *Hydrator*: specify the hydrator class to use for this given form or fieldset. A string value is
expected.
- *InputFilter*: specify the input filter class to use for this given form or fieldset. A string
* *InputFilter*: specify the input filter class to use for this given form or fieldset. A string
value is expected.
- *Input*: specify the input class to use for this given element. A string value is expected.
- *Instance*: specify an object class instance to bind to the form or fieldset.
- *Name*: specify the name of the current element, fieldset, or form. A string value is expected.
- *Object*: specify an object class instance to bind to the form or fieldset. (Note: this is
* *Input*: specify the input class to use for this given element. A string value is expected.
* *Instance*: specify an object class instance to bind to the form or fieldset.
* *Name*: specify the name of the current element, fieldset, or form. A string value is expected.
* *Object*: specify an object class instance to bind to the form or fieldset. (Note: this is
deprecated in 2.4.0; use *Instance* instead.)
- *Options*: options to pass to the fieldset or form that are used to inform behavior -- things that
* *Options*: options to pass to the fieldset or form that are used to inform behavior -- things that
are not attributes; e.g. labels, CAPTCHA adapters, etc. The annotation expects an associative array:
`@Options({"label": "Username:"})`.
- *Required*: indicate whether an element is required. A boolean value is expected. By default, all
* *Required*: indicate whether an element is required. A boolean value is expected. By default, all
elements are required, so this annotation is mainly present to allow disabling a requirement.
- *Type*: indicate the class to use for the current element, fieldset, or form. A string value is
* *Type*: indicate the class to use for the current element, fieldset, or form. A string value is
expected.
- *Validator*: provide a specification for a validator to use on a given element. Expects an
* *Validator*: provide a specification for a validator to use on a given element. Expects an
associative array of values, with a "name" key pointing to a string validator name, and an "options"
key pointing to an associative array of validator options for the constructor: `@Validator({"name":
"StringLength", "options": {"min":3, "max": 25}})`. This annotation may be specified multiple times.
Expand Down

0 comments on commit 51570c9

Please sign in to comment.