8000 Merge branch '4.1' into 4.2 · symfony/symfony-docs@e0f9dbe · GitHub
[go: up one dir, main page]

Skip to content

Commit e0f9dbe

Browse files
committed
Merge branch '4.1' into 4.2
* 4.1: Simplified the form theming docs MakerBundle uses urlGenerator instead of Router Update filesystem.rst Update form_dependencies.rst Fix encore advanced config watchOptions example [WebLink] Add an example using Priority Hints form_help description added Update form.rst Use "number" instead of "numeric" Update Range.rst
2 parents fd9765f + f18cbc8 commit e0f9dbe

22 files changed

+843
-1643
lines changed

_build/redirection_map

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,3 +403,5 @@
403403
/frontend/encore/installation-no-flex /frontend/encore/installation
404404
/http_cache/form_csrf_caching /security/csrf
405405
/console/logging /console
406+
/reference/forms/twig_reference /form/form_customization
407+
/form/rendering /form/form_customization

_images/form/form-field-parts.svg

Lines changed: 1 addition & 0 deletions
Loading
2 KB
Binary file not shown.

components/filesystem.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,14 @@ isAbsolutePath
279279
// returns false
280280
$fileSystem->isAbsolutePath('../dir');
281281

282+
tempnam
283+
~~~~~~~
284+
285+
:method:`Symfony\\Component\\Filesystem\\Filesystem::tempnam` creates a temporary file with a unique filename, and returns its path, or throw an exception on failure::
286+
287+
// returns a path like : /tmp/prefix_wyjgtF
288+
$filesystem->tempnam('/tmp', 'prefix_');
289+
282290
dumpFile
283291
~~~~~~~~
284292

components/form.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ support for very important features:
5757
The Symfony Form component relies on other libraries to solve these problems.
5858
Most of the time you will use Twig and the Symfony
5959
:doc:`HttpFoundation </components/http_foundation>`,
60-
Translation and Validator components, but you can replace any of these with
61-
a different library of your choice.
60+
:doc:`Translation </components/translation>` and :doc:`Validator </components/validator>`
61+
components, but you can replace any of these with a different library of your choice.
6262

6363
The following sections explain how to plug these libraries into the form
6464
factory.
@@ -177,8 +177,9 @@ between Twig and several Symfony components:
177177
178178
$ composer require symfony/twig-bridge
179179
180-
The TwigBridge integration provides you with several :doc:`Twig Functions </reference/forms/twig_reference>`
181-
that help you render the HTML widget, label and error for each field
180+
The TwigBridge integration provides you with several
181+
:ref:`Twig Functions <reference-form-twig-functions-variables>`
182+
that help you render the HTML widget, label, help and errors for each field
182183
(as well as a few other things). To configure the integration, you'll need
183184
to bootstrap or access Twig and add the :class:`Symfony\\Bridge\\Twig\\Extension\\FormExtension`::
184185

@@ -231,7 +232,7 @@ The exact details of your `Twig Configuration`_ will vary, but the goal is
231232
always to add the :class:`Symfony\\Bridge\\Twig\\Extension\\FormExtension`
232233
to Twig, which gives you access to the Twig functions for rendering forms.
233234
To do this, you first need to create a :class:`Symfony\\Bridge\\Twig\\Form\\TwigRendererEngine`,
234-
where you define your :ref:`form themes <form-customization-form-themes>`
235+
where you define your :doc:`form themes </form/form_themes>`
235236
(i.e. resources/files that define form HTML markup).
236237

237238
For general details on rendering forms, see :doc:`/form/form_customization`.
@@ -510,8 +511,8 @@ Rendering the Form
510511

511512
Now that the form has been created, the next step is to render it. This is
512513
done by passing a special form "view" object to your template (notice the
513-
``$form->createView()`` in the controller above) and using a set of form
514-
helper functions:
514+
``$form->createView()`` in the controller above) and using a set of
515+
:ref:`form helper functions <reference-form-twig-functions>`:
515516

516517
.. code-block:: html+twig
517518

@@ -528,7 +529,7 @@ That's it! By printing ``form_widget(form)``, each field in the form is
528529
rendered, along with a label and error message (if there is one). While this is
529530
convenient, it's not very flexible (yet). Usually, you'll want to render each
530531
form field individually so you can control how the form looks. You'll learn how
531-
to do that in the ":doc:`/form/rendering`" section.
532+
to do that in the :doc:`form customization </form/form_customization>` article.
532533

533534
Changing a Form's Method and Action
534535
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

form/create_custom_field_type.rst

Lines changed: 5 additions & 4 deletions
F438
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,9 @@ shipping options.
9999
Creating a Template for the Field
100100
---------------------------------
101101

102-
Each field type is rendered by a template fragment, which is determined in part by
103-
the class name of your type. For more information, see :ref:`form-customization-form-themes`.
102+
Each field type is rendered by a template fragment whose name is determined in
103+
part by the class name of your type. Read the :ref:`from fragment naming <form-fragment-naming>`
104+
rules for more details.
104105

105106
.. note::
106107

@@ -162,8 +163,8 @@ link for details), create a ``shipping_widget`` block to handle this:
162163
.. note::
163164

164165
Make sure the correct widget prefix is used. In this example the name should
165-
be ``shipping_widget`` (see :ref:`form-customization-form-themes`).
166-
Further, the main config file should point to the custom form template
166+
be ``shipping_widget`` (see :ref:`form fragment naming <form-fragment-naming>`
167+
rules). Further, the main config file should point to the custom form template
167168
so that it's used when rendering all forms.
168169

169170
When using Twig this is:

form/create_form_type_extension.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ Override the File Widget Template Fragment
181181

182182
Each field type is rendered by a template fragment. Those template fragments
183183
can be overridden in order to customize form rendering. For more information,
184-
you can refer to the :ref:`form-customization-form-themes` article.
184+
you can refer to the :ref:`form fragment naming <form-fragment-naming>` rules.
185185

186186
In your extension class, you added a new variable (``image_url``), but
187187
you still need to take advantage of this new variable in your templates.

0 commit comments

Comments
 (0)
0