Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcf7db08

Browse files
committed
Merge pull requestsymfony#2997 from WouterJ/fix_form_component
Fixes for Form Component chapter
2 parents5676bc5 +ce10a30 commitcf7db08

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

‎components/form/introduction.rst

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ be from a normal form post or from an API.
1717
Installation
1818
------------
1919

20-
You can install the component inmany different ways:
20+
You can install the component in2 different ways:
2121

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

2525
Configuration
2626
-------------
@@ -51,7 +51,8 @@ support for very important features:
5151
messages for submitted data.
5252

5353
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>`,
5556
Translation and Validator components, but you can replace any of these with
5657
a different library of your choice.
5758

@@ -65,10 +66,12 @@ factory.
6566
Request Handling
6667
~~~~~~~~~~~~~~~~
6768

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.
7275

7376
To integrate the HttpFoundation component, add the
7477
:class:`Symfony\\Component\\Form\\Extension\\HttpFoundation\HttpFoundationExtension`
@@ -155,7 +158,7 @@ line to your ``composer.json`` file:
155158
}
156159
}
157160
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>`
159162
that help you render each the HTML widget, label and error for each field
160163
(as well as a few other things). To configure the integration, you'll need
161164
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
193196
always to add the:class:`Symfony\\Bridge\\Twig\\Extension\\FormExtension`
194197
to Twig, which gives you access to the Twig functions for rendering forms.
195198
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>`
197200
(i.e. resources/files that define form HTML markup).
198201

199202
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,
219222
via your own Twig extension.
220223

221224
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
223226
installed. If you're using Composer, you could get the latest 2.1 version
224227
of each of these by adding the following to your ``composer.json`` file:
225228

@@ -404,10 +407,10 @@ is created from the form factory.
404407
As you can see, creating a form is like writing a recipe: you call ``add``
405408
for each new field you want to create. The first argument to ``add`` is the
406409
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>`.
408411

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>`.
411414

412415
Setting Default Values
413416
~~~~~~~~~~~~~~~~~~~~~~
@@ -443,7 +446,7 @@ builder:
443446
..tip::
444447

445448
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
447450
to objects, your default data will be an instance of that object.
448451

449452
.. _component-form-intro-rendering-form:
@@ -618,4 +621,4 @@ and the errors will display next to the fields on error.
618621

619622
.. _Packagist:https://packagist.org/packages/symfony/form
620623
.. _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

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp