@@ -17,10 +17,10 @@ be from a normal form post or from an API.
17
17
Installation
18
18
------------
19
19
20
- You can install the component in many different ways:
20
+ You can install the component in 2 different ways:
21
21
22
22
* Use the official Git repository (https://github.com/symfony/Form);
23
- * Install it via Composer (``symfony/form `` on `Packagist `_).
23
+ * :doc: ` Install it via Composer < /components/using_components >` (``symfony/form `` on `Packagist `_).
24
24
25
25
Configuration
26
26
-------------
@@ -51,7 +51,8 @@ support for very important features:
51
51
messages for submitted data.
52
52
53
53
The Symfony2 Form component relies on other libraries to solve these problems.
54
- Most of the time you will use Twig and the Symfony :doc: `HttpFoundation</components/http_foundation/introduction> `,
54
+ Most of the time you will use Twig and the Symfony
55
+ :doc: `HttpFoundation </components/http_foundation/introduction >`,
55
56
Translation and Validator components, but you can replace any of these with
56
57
a different library of your choice.
57
58
@@ -65,10 +66,12 @@ factory.
65
66
Request Handling
66
67
~~~~~~~~~~~~~~~~
67
68
68
- To process form data, you'll need to grab information off of the request (typically
69
- ``$_POST `` data) and pass the array of submitted data to :method: `Symfony\\ Component\\ Form\\ Form::bind `.
70
- The Form component optionally integrates with Symfony's :doc: `HttpFoundation</components/http_foundation/introduction> `
71
- component to make this even easier.
69
+ To process form data, you'll need to grab information off of the request
70
+ (typically ``$_POST `` data) and pass the array of submitted data to
71
+ :method: `Symfony\\ Component\\ Form\\ Form::bind `. The Form component optionally
72
+ integrates with Symfony's
73
+ :doc: `HttpFoundation </components/http_foundation/introduction >` component to
74
+ make this even easier.
72
75
73
76
To integrate the HttpFoundation component, add the
74
77
:class: `Symfony\\ Component\\ Form\\ Extension\\ HttpFoundation\H ttpFoundationExtension `
@@ -155,7 +158,7 @@ line to your ``composer.json`` file:
155
158
}
156
159
}
157
160
158
- The TwigBridge integration provides you with several :doc: `Twig Functions</reference/forms/twig_reference> `
161
+ The TwigBridge integration provides you with several :doc: `Twig Functions </reference/forms/twig_reference >`
159
162
that help you render each the HTML widget, label and error for each field
160
163
(as well as a few other things). To configure the integration, you'll need
161
164
to bootstrap or access Twig and add the :class: `Symfony\\ Bridge\\ Twig\\ Extension\\ FormExtension `::
@@ -193,7 +196,7 @@ The exact details of your `Twig Configuration`_ will vary, but the goal is
193
196
always to add the :class: `Symfony\\ Bridge\\ Twig\\ Extension\\ FormExtension `
194
197
to Twig, which gives you access to the Twig functions for rendering forms.
195
198
To do this, you first need to create a :class: `Symfony\\ Bridge\\ Twig\\ Form\\ TwigRendererEngine `,
196
- where you define your :ref: `form themes<cookbook-form-customization-form-themes> `
199
+ where you define your :ref: `form themes <cookbook-form-customization-form-themes >`
197
200
(i.e. resources/files that define form HTML markup).
198
201
199
202
For general details on rendering forms, see :doc: `/cookbook/form/form_customization `.
@@ -219,7 +222,7 @@ with Symfony's ``Translation`` component, or add the 2 Twig filters yourself,
219
222
via your own Twig extension.
220
223
221
224
To use the built-in integration, be sure that your project has Symfony's
222
- ``Translation `` and :doc: `Config</components/config/introduction> ` components
225
+ ``Translation `` and :doc: `Config </components/config/introduction >` components
223
226
installed. If you're using Composer, you could get the latest 2.1 version
224
227
of each of these by adding the following to your ``composer.json `` file:
225
228
@@ -404,10 +407,10 @@ is created from the form factory.
404
407
As you can see, creating a form is like writing a recipe: you call ``add ``
405
408
for each new field you want to create. The first argument to ``add `` is the
406
409
name of your field, and the second is the field "type". The Form component
407
- comes with a lot of :doc: `built-in types</reference/forms/types> `.
410
+ comes with a lot of :doc: `built-in types </reference/forms/types >`.
408
411
409
- Now that you've built your form, learn how to :ref: `render<component-form-intro-rendering-form> `
410
- it and :ref: `process the form submission<component-form-intro-handling-submission> `.
412
+ Now that you've built your form, learn how to :ref: `render <component-form-intro-rendering-form >`
413
+ it and :ref: `process the form submission <component-form-intro-handling-submission >`.
411
414
412
415
Setting Default Values
413
416
~~~~~~~~~~~~~~~~~~~~~~
@@ -443,7 +446,7 @@ builder:
443
446
.. tip ::
444
447
445
448
In this example, the default data is an array. Later, when you use the
446
- :ref: `data_class<book-forms-data-class> ` option to bind data directly
449
+ :ref: `data_class <book-forms-data-class >` option to bind data directly
447
450
to objects, your default data will be an instance of that object.
448
451
449
452
.. _component-form-intro-rendering-form :
@@ -618,4 +621,4 @@ and the errors will display next to the fields on error.
618
621
619
622
.. _Packagist : https://packagist.org/packages/symfony/form
620
623
.. _Twig : http://twig.sensiolabs.org
621
- .. _`Twig Configuration` : http://twig.sensiolabs.org/doc/intro.html
624
+ .. _`Twig Configuration` : http://twig.sensiolabs.org/doc/intro.html
0 commit comments