Skip to content

Commit 6995b07

Browse files
committed
minor #4435 consistent table headlines (xabbuh)
This PR was merged into the 2.3 branch. Discussion ---------- consistent table headlines | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | all | Fixed tickets | Commits ------- 10b607b separate table columns with two spaces 178a2d6 consistent table headlines
2 parents 0380d34 + 10b607b commit 6995b07

40 files changed

+193
-217
lines changed

best_practices/templates.rst

Lines changed: 9 additions & 9 deletions
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

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -522,13 +522,13 @@ longer required. The URL ``/blog`` will match this route and the value of
522522
the ``page`` parameter will be set to ``1``. The URL ``/blog/2`` will also
523523
match, giving the ``page`` parameter a value of ``2``. Perfect.
524524

525-
=========== ===== ==========
526-
URL route parameters
527-
=========== ===== ==========
528-
``/blog`` blog {page} = 1
529-
``/blog/1`` blog {page} = 1
530-
``/blog/2`` blog {page} = 2
531-
=========== ===== ==========
525+
=========== ======== ==================
526+
URL Route Parameters
527+
=========== ======== ==================
528+
``/blog`` ``blog`` ``{page}`` = ``1``
529+
``/blog/1`` ``blog`` ``{page}`` = ``1``
530+
``/blog/2`` ``blog`` ``{page}`` = ``2``
531+
=========== ======== ==================
532532

533533
.. caution::
534534

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

634-
+--------------------+-------+-----------------------+
635-
| URL | route | parameters |
636-
+====================+=======+=======================+
637-
| /blog/2 | blog | {page} = 2 |
638-
+--------------------+-------+-----------------------+
639-
| /blog/my-blog-post | blog | {page} = my-blog-post |
640-
+--------------------+-------+-----------------------+
634+
====================== ======== ===============================
635+
URL Route Parameters
636+
====================== ======== ===============================
637+
``/blog/2`` ``blog`` ``{page}`` = ``2``
638+
``/blog/my-blog-post`` ``blog`` ``{page}`` = ``"my-blog-post"``
639+
====================== ======== ===============================
641640

642641
The answer to the problem is to add route *requirements*. The routes in this
643642
example would work perfectly if the ``/blog/{page}`` path *only* matched
@@ -710,15 +709,13 @@ is *not* a number).
710709
As a result, a URL like ``/blog/my-blog-post`` will now properly match the
711710
``blog_show`` route.
712711

713-
+----------------------+-----------+-------------------------+
714-
| URL | route | parameters |
715-
+======================+===========+=========================+
716-
| /blog/2 | blog | {page} = 2 |
717-
+----------------------+-----------+-------------------------+
718-
| /blog/my-blog-post | blog_show | {slug} = my-blog-post |
719-
+----------------------+-----------+-------------------------+
720-
| /blog/2-my-blog-post | blog_show | {slug} = 2-my-blog-post |
721-
+----------------------+-----------+-------------------------+
712+
======================== ============= ===============================
713+
URL Route Parameters
714+
======================== ============= ===============================
715+
``/blog/2`` ``blog`` ``{page}`` = ``2``
716+
``/blog/my-blog-post`` ``blog_show`` ``{slug}`` = ``my-blog-post``
717+
``/blog/2-my-blog-post`` ``blog_show`` ``{slug}`` = ``2-my-blog-post``
718+
======================== ============= ===============================
722719

723720
.. sidebar:: Earlier Routes always Win
724721

@@ -794,14 +791,14 @@ URL:
794791
For incoming requests, the ``{_locale}`` portion of the URL is matched against
795792
the regular expression ``(en|fr)``.
796793

797-
======= ========================
798-
path parameters
799-
======= ========================
800-
``/`` {_locale} = en
801-
``/en`` {_locale} = en
802-
``/fr`` {_locale} = fr
803-
``/es`` *won't match this route*
804-
======= ========================
794+
======= ========================
795+
Path Parameters
796+
======= ========================
797+
``/`` ``{_locale}`` = ``"en"``
798+
``/en`` ``{_locale}`` = ``"en"``
799+
``/fr`` ``{_locale}`` = ``"fr"``
800+
``/es`` *won't match this route*
801+
======= ========================
805802

806803
.. index::
807804
single: Routing; Method requirement
@@ -1065,11 +1062,11 @@ each separated by a colon:
10651062

10661063
For example, a ``_controller`` value of ``AppBundle:Blog:show`` means:
10671064

1068-
========= ================== ==============
1069-
Bundle Controller Class Method Name
1070-
========= ================== ==============
1071-
AppBundle ``BlogController`` ``showAction``
1072-
========= ================== ==============
1065+
========= ================== ==============
1066+
Bundle Controller Class Method Name
1067+
========= ================== ==============
1068+
AppBundle ``BlogController`` ``showAction``
1069+
========= ================== ==============
10731070

10741071
The controller might look like this::
10751072

book/templating.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -444,13 +444,13 @@ Template Suffix
444444
Every template name also has two extensions that specify the *format* and
445445
*engine* for that template.
446446

447-
======================== ====== ======
448-
Filename Format Engine
449-
======================== ====== ======
450-
``Blog/index.html.twig`` HTML Twig
451-
``Blog/index.html.php`` HTML PHP
452-
``Blog/index.css.twig`` CSS Twig
453-
======================== ====== ======
447+
======================== ====== ======
448+
Filename Format Engine
449+
======================== ====== ======
450+
``Blog/index.html.twig`` HTML Twig
451+
``Blog/index.html.php`` HTML PHP
452+
``Blog/index.css.twig`` CSS Twig
453+
======================== ====== ======
454454

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

components/class_loader/class_map_generator.rst

Lines changed: 8 additions & 11 deletions
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

Lines changed: 44 additions & 58 deletions
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

@@ -140,15 +136,13 @@ It can be used to:
140136

141137
:ref:`Form Events Information Table<component-form-event-table>`
142138

143-
+-----------------+------------------------------------------+
144-
| Data type | Value |
145-
+=================+==========================================+
146-
| Model data | Same as in ``FormEvents::POST_SET_DATA`` |
147-
+-----------------+------------------------------------------+
148-
| Normalized data | Same as in ``FormEvents::POST_SET_DATA`` |
149-
+-----------------+------------------------------------------+
150-
| View data | Same as in ``FormEvents::POST_SET_DATA`` |
151-
+-----------------+------------------------------------------+
139+
=============== ========================================
140+
Data Type Value
141+
=============== ========================================
142+
Model data Same as in ``FormEvents::POST_SET_DATA``
143+
Normalized data Same as in ``FormEvents::POST_SET_DATA``
144+
View data Same as in ``FormEvents::POST_SET_DATA``
145+
=============== ========================================
152146

153147
.. sidebar:: ``FormEvents::PRE_SUBMIT`` in the Form component
154148

@@ -170,15 +164,13 @@ It can be used to change data from the normalized representation of the data.
170164

171165
:ref:`Form Events Information Table<component-form-event-table>`
172166

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

183175
.. caution::
184176

@@ -202,15 +194,13 @@ It can be used to fetch data after denormalization.
202194

203195
:ref:`Form Events Information Table<component-form-event-table>`
204196

205-
+-----------------+---------------------------------------------------------------+
206-
| Data type | Value |
207-
+=================+===============================================================+
208-
| Model data | Normalized data reverse-transformed using a model transformer |
209-
+-----------------+---------------------------------------------------------------+
210-
| Normalized data | Same as in ``FormEvents::POST_SUBMIT`` |
211-
+-----------------+---------------------------------------------------------------+
212-
| View data | Normalized data transformed using a view transformer |
213-
+-----------------+---------------------------------------------------------------+
197+
=============== =============================================================
198+
Data Type Value
199+
=============== =============================================================
200+
Model data Normalized data reverse-transformed using a model transformer
201+
Normalized data Same as in ``FormEvents::POST_SUBMIT``
202+
View data Normalized data transformed using a view transformer
203+
=============== =============================================================
214204

215205
.. caution::
216206

@@ -242,19 +232,15 @@ processed.
242232

243233
.. _component-form-event-table:
244234

245-
+------------------------+-------------------------------+------------------+
246-
| Name | ``FormEvents`` Constant | Event's data |
247-
+========================+===============================+==================+
248-
| ``form.pre_set_data`` | ``FormEvents::PRE_SET_DATA`` | Model data |
249-
+------------------------+-------------------------------+------------------+
250-
| ``form.post_set_data`` | ``FormEvents::POST_SET_DATA`` | Model data |
251-
+------------------------+-------------------------------+------------------+
252-
| ``form.pre_bind`` | ``FormEvents::PRE_SUBMIT`` | Request data |
253-
+------------------------+-------------------------------+------------------+
254-
| ``form.bind`` | ``FormEvents::SUBMIT`` | Normalized data |
255-
+------------------------+-------------------------------+------------------+
256-
| ``form.post_bind`` | ``FormEvents::POST_SUBMIT`` | View data |
257-
+------------------------+-------------------------------+------------------+
235+
====================== ============================= ===============
236+
Name ``FormEvents`` Constant Event's Data
237+
====================== ============================= ===============
238+
``form.pre_set_data`` ``FormEvents::PRE_SET_DATA`` Model data
239+
``form.post_set_data`` ``FormEvents::POST_SET_DATA`` Model data
240+
``form.pre_bind`` ``FormEvents::PRE_SUBMIT`` Request data
241+
``form.bind`` ``FormEvents::SUBMIT`` Normalized data
242+
``form.post_bind`` ``FormEvents::POST_SUBMIT`` View data
243+
====================== ============================= ===============
258244

259245
.. versionadded:: 2.3
260246
Before Symfony 2.3, ``FormEvents::PRE_SUBMIT``, ``FormEvents::SUBMIT``

components/http_kernel/introduction.rst

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -575,21 +575,16 @@ 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.terminate | ``KernelEvents::TERMINATE`` | :class:`Symfony\\Component\\HttpKernel\\Event\\PostResponseEvent` |
590-
+-------------------+-------------------------------+-------------------------------------------------------------------------------------+
591-
| kernel.exception | ``KernelEvents::EXCEPTION`` | :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent` |
592-
+-------------------+-------------------------------+-------------------------------------------------------------------------------------+
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.terminate ``KernelEvents::TERMINATE`` :class:`Symfony\\Component\\HttpKernel\\Event\\PostResponseEvent`
586+
kernel.exception ``KernelEvents::EXCEPTION`` :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent`
587+
================= ============================ ===================================================================================
593588

594589
.. _http-kernel-working-example:
595590

contributing/documentation/format.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ The previous reST snippet renders as follow:
9292
The current list of supported formats are the following:
9393

9494
=================== ======================================
95-
Markup format Use it to display
95+
Markup Format Use It to Display
9696
=================== ======================================
9797
``html`` HTML
9898
``xml`` XML

0 commit comments

Comments
 (0)