Skip to content

Commit 0c92fab

Browse files
committed
Merge branch '2.7'
* 2.7: separate table columns with two spaces consistent table headlines
2 parents 0d5cb0d + ad4c1f0 commit 0c92fab

39 files changed

+189
-215
lines changed

best_practices/templates.rst

+9-9
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ But for the templates used in your application, it's much more convenient
3737
to store them in the ``app/Resources/views/`` directory. For starters, this
3838
drastically simplifies their logical names:
3939

40-
================================================== ==================================
41-
Templates stored inside bundles Templates stored in ``app/``
42-
================================================== ==================================
43-
``AcmeDemoBundle:Default:index.html.twig`` ``default/index.html.twig``
44-
``::layout.html.twig`` ``layout.html.twig``
45-
``AcmeDemoBundle::index.html.twig`` ``index.html.twig``
46-
``AcmeDemoBundle:Default:subdir/index.html.twig`` ``default/subdir/index.html.twig``
47-
``AcmeDemoBundle:Default/subdir:index.html.twig`` ``default/subdir/index.html.twig``
48-
================================================== ==================================
40+
================================================= ==================================
41+
Templates Stored inside Bundles Templates Stored in ``app/``
42+
================================================= ==================================
43+
``AcmeDemoBundle:Default:index.html.twig`` ``default/index.html.twig``
44+
``::layout.html.twig`` ``layout.html.twig``
45+
``AcmeDemoBundle::index.html.twig`` ``index.html.twig``
46+
``AcmeDemoBundle:Default:subdir/index.html.twig`` ``default/subdir/index.html.twig``
47+
``AcmeDemoBundle:Default/subdir:index.html.twig`` ``default/subdir/index.html.twig``
48+
================================================= ==================================
4949

5050
Another advantage is that centralizing your templates simplifies the work
5151
of your designers. They don't need to look for templates in lots of directories

book/routing.rst

+33-36
Original file line numberDiff line numberDiff line change
@@ -518,13 +518,13 @@ longer required. The URL ``/blog`` will match this route and the value of
518518
the ``page`` parameter will be set to ``1``. The URL ``/blog/2`` will also
519519
match, giving the ``page`` parameter a value of ``2``. Perfect.
520520

521-
=========== ===== ==========
522-
URL route parameters
523-
=========== ===== ==========
524-
``/blog`` blog {page} = 1
525-
``/blog/1`` blog {page} = 1
526-
``/blog/2`` blog {page} = 2
527-
=========== ===== ==========
521+
=========== ======== ==================
522+
URL Route Parameters
523+
=========== ======== ==================
524+
``/blog`` ``blog`` ``{page}`` = ``1``
525+
``/blog/1`` ``blog`` ``{page}`` = ``1``
526+
``/blog/2`` ``blog`` ``{page}`` = ``2``
527+
=========== ======== ==================
528528

529529
.. caution::
530530

@@ -627,13 +627,12 @@ will *never* be matched. Instead, a URL like ``/blog/my-blog-post`` will match
627627
the first route (``blog``) and return a nonsense value of ``my-blog-post``
628628
to the ``{page}`` parameter.
629629

630-
+--------------------+-------+-----------------------+
631-
| URL | route | parameters |
632-
+====================+=======+=======================+
633-
| /blog/2 | blog | {page} = 2 |
634-
+--------------------+-------+-----------------------+
635-
| /blog/my-blog-post | blog | {page} = my-blog-post |
636-
+--------------------+-------+-----------------------+
630+
====================== ======== ===============================
631+
URL Route Parameters
632+
====================== ======== ===============================
633+
``/blog/2`` ``blog`` ``{page}`` = ``2``
634+
``/blog/my-blog-post`` ``blog`` ``{page}`` = ``"my-blog-post"``
635+
====================== ======== ===============================
637636

638637
The answer to the problem is to add route *requirements* or route *conditions*
639638
(see :ref:`book-routing-conditions`). The routes in this example would work
@@ -707,15 +706,13 @@ is *not* a number).
707706
As a result, a URL like ``/blog/my-blog-post`` will now properly match the
708707
``blog_show`` route.
709708

710-
+----------------------+-----------+-------------------------+
711-
| URL | route | parameters |
712-
+======================+===========+=========================+
713-
| /blog/2 | blog | {page} = 2 |
714-
+----------------------+-----------+-------------------------+
715-
| /blog/my-blog-post | blog_show | {slug} = my-blog-post |
716-
+----------------------+-----------+-------------------------+
717-
| /blog/2-my-blog-post | blog_show | {slug} = 2-my-blog-post |
718-
+----------------------+-----------+-------------------------+
709+
======================== ============= ===============================
710+
URL Route Parameters
711+
======================== ============= ===============================
712+
``/blog/2`` ``blog`` ``{page}`` = ``2``
713+
``/blog/my-blog-post`` ``blog_show`` ``{slug}`` = ``my-blog-post``
714+
``/blog/2-my-blog-post`` ``blog_show`` ``{slug}`` = ``2-my-blog-post``
715+
======================== ============= ===============================
719716

720717
.. sidebar:: Earlier Routes always Win
721718

@@ -791,14 +788,14 @@ URL:
791788
For incoming requests, the ``{_locale}`` portion of the URL is matched against
792789
the regular expression ``(en|fr)``.
793790

794-
======= ========================
795-
path parameters
796-
======= ========================
797-
``/`` {_locale} = en
798-
``/en`` {_locale} = en
799-
``/fr`` {_locale} = fr
800-
``/es`` *won't match this route*
801-
======= ========================
791+
======= ========================
792+
Path Parameters
793+
======= ========================
794+
``/`` ``{_locale}`` = ``"en"``
795+
``/en`` ``{_locale}`` = ``"en"``
796+
``/fr`` ``{_locale}`` = ``"fr"``
797+
``/es`` *won't match this route*
798+
======= ========================
802799

803800
.. index::
804801
single: Routing; Method requirement
@@ -1142,11 +1139,11 @@ each separated by a colon:
11421139

11431140
For example, a ``_controller`` value of ``AppBundle:Blog:show`` means:
11441141

1145-
========= ================== ==============
1146-
Bundle Controller Class Method Name
1147-
========= ================== ==============
1148-
AppBundle ``BlogController`` ``showAction``
1149-
========= ================== ==============
1142+
========= ================== ==============
1143+
Bundle Controller Class Method Name
1144+
========= ================== ==============
1145+
AppBundle ``BlogController`` ``showAction``
1146+
========= ================== ==============
11501147

11511148
The controller might look like this::
11521149

book/templating.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -439,13 +439,13 @@ Template Suffix
439439
Every template name also has two extensions that specify the *format* and
440440
*engine* for that template.
441441

442-
======================== ====== ======
443-
Filename Format Engine
444-
======================== ====== ======
445-
``Blog/index.html.twig`` HTML Twig
446-
``Blog/index.html.php`` HTML PHP
447-
``Blog/index.css.twig`` CSS Twig
448-
======================== ====== ======
442+
======================== ====== ======
443+
Filename Format Engine
444+
======================== ====== ======
445+
``Blog/index.html.twig`` HTML Twig
446+
``Blog/index.html.php`` HTML PHP
447+
``Blog/index.css.twig`` CSS Twig
448+
======================== ====== ======
449449

450450
By default, any Symfony template can be written in either Twig or PHP, and
451451
the last part of the extension (e.g. ``.twig`` or ``.php``) specifies which

components/class_loader/class_map_generator.rst

+8-11
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,14 @@ manually. For example, imagine a library with the following directory structure:
2828
2929
These files contain the following classes:
3030

31-
=========================== ================
32-
File Class name
33-
=========================== ================
34-
``library/bar/baz/Boo.php`` ``Acme\Bar\Baz``
35-
--------------------------- ----------------
36-
``library/bar/Foo.php`` ``Acme\Bar``
37-
--------------------------- ----------------
38-
``library/foo/bar/Foo.php`` ``Acme\Foo\Bar``
39-
--------------------------- ----------------
40-
``library/foo/Bar.php`` ``Acme\Foo``
41-
=========================== ================
31+
=========================== ================
32+
File Class Name
33+
=========================== ================
34+
``library/bar/baz/Boo.php`` ``Acme\Bar\Baz``
35+
``library/bar/Foo.php`` ``Acme\Bar``
36+
``library/foo/bar/Foo.php`` ``Acme\Foo\Bar``
37+
``library/foo/Bar.php`` ``Acme\Foo``
38+
=========================== ================
4239

4340
To make your life easier, the ClassLoader component comes with a
4441
:class:`Symfony\\Component\\ClassLoader\\ClassMapGenerator` class that makes

components/form/form_events.rst

+44-58
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,13 @@ The ``FormEvents::PRE_SET_DATA`` event is dispatched at the beginning of the
6161

6262
:ref:`Form Events Information Table<component-form-event-table>`
6363

64-
+-----------------+-----------+
65-
| Data type | Value |
66-
+=================+===========+
67-
| Model data | ``null`` |
68-
+-----------------+-----------+
69-
| Normalized data | ``null`` |
70-
+-----------------+-----------+
71-
| View data | ``null`` |
72-
+-----------------+-----------+
64+
=============== ========
65+
Data Type Value
66+
=============== ========
67+
Model data ``null``
68+
Normalized data ``null``
69+
View data ``null``
70+
=============== ========
7371

7472
.. caution::
7573

@@ -98,15 +96,13 @@ the form.
9896

9997
:ref:`Form Events Information Table<component-form-event-table>`
10098

101-
+-----------------+------------------------------------------------------+
102-
| Data type | Value |
103-
+=================+======================================================+
104-
| Model data | Model data injected into ``setData()`` |
105-
+-----------------+------------------------------------------------------+
106-
| Normalized data | Model data transformed using a model transformer |
107-
+-----------------+------------------------------------------------------+
108-
| View data | Normalized data transformed using a view transformer |
109-
+-----------------+------------------------------------------------------+
99+
=============== ====================================================
100+
Data Type Value
101+
=============== ====================================================
102+
Model data Model data injected into ``setData()``
103+
Normalized data Model data transformed using a model transformer
104+
View data Normalized data transformed using a view transformer
105+
=============== ====================================================
110106

111107
.. sidebar:: ``FormEvents::POST_SET_DATA`` in the Form component
112108

@@ -143,15 +139,13 @@ It can be used to:
143139

144140
:ref:`Form Events Information Table<component-form-event-table>`
145141

146-
+-----------------+------------------------------------------+
147-
| Data type | Value |
148-
+=================+==========================================+
149-
| Model data | Same as in ``FormEvents::POST_SET_DATA`` |
150-
+-----------------+------------------------------------------+
151-
| Normalized data | Same as in ``FormEvents::POST_SET_DATA`` |
152-
+-----------------+------------------------------------------+
153-
| View data | Same as in ``FormEvents::POST_SET_DATA`` |
154-
+-----------------+------------------------------------------+
142+
=============== ========================================
143+
Data Type Value
144+
=============== ========================================
145+
Model data Same as in ``FormEvents::POST_SET_DATA``
146+
Normalized data Same as in ``FormEvents::POST_SET_DATA``
147+
View data Same as in ``FormEvents::POST_SET_DATA``
148+
=============== ========================================
155149

156150
.. sidebar:: ``FormEvents::PRE_SUBMIT`` in the Form component
157151

@@ -173,15 +167,13 @@ It can be used to change data from the normalized representation of the data.
173167

174168
:ref:`Form Events Information Table<component-form-event-table>`
175169

176-
+-----------------+-------------------------------------------------------------------------------------+
177-
| Data type | Value |
178-
+=================+=====================================================================================+
179-
| Model data | Same as in ``FormEvents::POST_SET_DATA`` |
180-
+-----------------+-------------------------------------------------------------------------------------+
181-
| Normalized data | Data from the request reverse-transformed from the request using a view transformer |
182-
+-----------------+-------------------------------------------------------------------------------------+
183-
| View data | Same as in ``FormEvents::POST_SET_DATA`` |
184-
+-----------------+-------------------------------------------------------------------------------------+
170+
=============== ===================================================================================
171+
Data Type Value
172+
=============== ===================================================================================
173+
Model data Same as in ``FormEvents::POST_SET_DATA``
174+
Normalized data Data from the request reverse-transformed from the request using a view transformer
175+
View data Same as in ``FormEvents::POST_SET_DATA``
176+
=============== ===================================================================================
185177

186178
.. caution::
187179

@@ -205,15 +197,13 @@ It can be used to fetch data after denormalization.
205197

206198
:ref:`Form Events Information Table<component-form-event-table>`
207199

208-
+-----------------+---------------------------------------------------------------+
209-
| Data type | Value |
210-
+=================+===============================================================+
211-
| Model data | Normalized data reverse-transformed using a model transformer |
212-
+-----------------+---------------------------------------------------------------+
213-
| Normalized data | Same as in ``FormEvents::POST_SUBMIT`` |
214-
+-----------------+---------------------------------------------------------------+
215-
| View data | Normalized data transformed using a view transformer |
216-
+-----------------+---------------------------------------------------------------+
200+
=============== =============================================================
201+
Data Type Value
202+
=============== =============================================================
203+
Model data Normalized data reverse-transformed using a model transformer
204+
Normalized data Same as in ``FormEvents::POST_SUBMIT``
205+
View data Normalized data transformed using a view transformer
206+
=============== =============================================================
217207

218208
.. caution::
219209

@@ -248,19 +238,15 @@ processed.
248238

249239
.. _component-form-event-table:
250240

251-
+------------------------+-------------------------------+------------------+
252-
| Name | ``FormEvents`` Constant | Event's data |
253-
+========================+===============================+==================+
254-
| ``form.pre_set_data`` | ``FormEvents::PRE_SET_DATA`` | Model data |
255-
+------------------------+-------------------------------+------------------+
256-
| ``form.post_set_data`` | ``FormEvents::POST_SET_DATA`` | Model data |
257-
+------------------------+-------------------------------+------------------+
258-
| ``form.pre_bind`` | ``FormEvents::PRE_SUBMIT`` | Request data |
259-
+------------------------+-------------------------------+------------------+
260-
| ``form.bind`` | ``FormEvents::SUBMIT`` | Normalized data |
261-
+------------------------+-------------------------------+------------------+
262-
| ``form.post_bind`` | ``FormEvents::POST_SUBMIT`` | View data |
263-
+------------------------+-------------------------------+------------------+
241+
====================== ============================= ===============
242+
Name ``FormEvents`` Constant Event's Data
243+
====================== ============================= ===============
244+
``form.pre_set_data`` ``FormEvents::PRE_SET_DATA`` Model data
245+
``form.post_set_data`` ``FormEvents::POST_SET_DATA`` Model data
246+
``form.pre_bind`` ``FormEvents::PRE_SUBMIT`` Request data
247+
``form.bind`` ``FormEvents::SUBMIT`` Normalized data
248+
``form.post_bind`` ``FormEvents::POST_SUBMIT`` View data
249+
====================== ============================= ===============
264250

265251
.. versionadded:: 2.3
266252
Before Symfony 2.3, ``FormEvents::PRE_SUBMIT``, ``FormEvents::SUBMIT``

components/http_kernel/introduction.rst

+11-17
Original file line numberDiff line numberDiff line change
@@ -575,23 +575,17 @@ each event has their own event object:
575575

576576
.. _component-http-kernel-event-table:
577577

578-
+-----------------------+----------------------------------+-------------------------------------------------------------------------------------+
579-
| Name | ``KernelEvents`` Constant | Argument passed to the listener |
580-
+=======================+==================================+=====================================================================================+
581-
| kernel.request | ``KernelEvents::REQUEST`` | :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent` |
582-
+-----------------------+----------------------------------+-------------------------------------------------------------------------------------+
583-
| kernel.controller | ``KernelEvents::CONTROLLER`` | :class:`Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent` |
584-
+-----------------------+----------------------------------+-------------------------------------------------------------------------------------+
585-
| kernel.view | ``KernelEvents::VIEW`` | :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent` |
586-
+-----------------------+----------------------------------+-------------------------------------------------------------------------------------+
587-
| kernel.response | ``KernelEvents::RESPONSE`` | :class:`Symfony\\Component\\HttpKernel\\Event\\FilterResponseEvent` |
588-
+-----------------------+----------------------------------+-------------------------------------------------------------------------------------+
589-
| kernel.finish_request | ``KernelEvents::FINISH_REQUEST`` | :class:`Symfony\\Component\\HttpKernel\\Event\\FinishRequestEvent` |
590-
+-----------------------+----------------------------------+-------------------------------------------------------------------------------------+
591-
| kernel.terminate | ``KernelEvents::TERMINATE`` | :class:`Symfony\\Component\\HttpKernel\\Event\\PostResponseEvent` |
592-
+-----------------------+----------------------------------+-------------------------------------------------------------------------------------+
593-
| kernel.exception | ``KernelEvents::EXCEPTION`` | :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent` |
594-
+-----------------------+----------------------------------+-------------------------------------------------------------------------------------+
578+
===================== ================================ ===================================================================================
579+
Name ``KernelEvents`` Constant Argument passed to the listener
580+
===================== ================================ ===================================================================================
581+
kernel.request ``KernelEvents::REQUEST`` :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent`
582+
kernel.controller ``KernelEvents::CONTROLLER`` :class:`Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent`
583+
kernel.view ``KernelEvents::VIEW`` :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent`
584+
kernel.response ``KernelEvents::RESPONSE`` :class:`Symfony\\Component\\HttpKernel\\Event\\FilterResponseEvent`
585+
kernel.finish_request ``KernelEvents::FINISH_REQUEST`` :class:`Symfony\\Component\\HttpKernel\\Event\\FinishRequestEvent`
586+
kernel.terminate ``KernelEvents::TERMINATE`` :class:`Symfony\\Component\\HttpKernel\\Event\\PostResponseEvent`
587+
kernel.exception ``KernelEvents::EXCEPTION`` :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent`
588+
===================== ================================ ===================================================================================
595589

596590
.. _http-kernel-working-example:
597591

0 commit comments

Comments
 (0)