8000 consistent table headlines by xabbuh · Pull Request #4435 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

consistent table headlines #4435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 13, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
consistent table headlines
  • Loading branch information
xabbuh committed Nov 13, 2014
commit 178a2d6dccb79573a2f1721552f2ac2c5086eded
18 changes: 9 additions & 9 deletions best_practices/templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ But for the templates used in your application, it's much more convenient
to store them in the ``app/Resources/views/`` directory. For starters, this
drastically simplifies their logical names:

================================================== ==================================
Templates stored inside bundles Templates stored in ``app/``
================================================== ==================================
``AcmeDemoBundle:Default:index.html.twig`` ``default/index.html.twig``
``::layout.html.twig`` ``layout.html.twig``
``AcmeDemoBundle::index.html.twig`` ``index.html.twig``
``AcmeDemoBundle:Default:subdir/index.html.twig`` ``default/subdir/index.html.twig``
``AcmeDemoBundle:Default/subdir:index.html.twig`` ``default/subdir/index.html.twig``
================================================== ==================================
================================================= ==================================
Templates Stored inside Bundles Templates Stored in ``app/``
================================================= ==================================
``AcmeDemoBundle:Default:index.html.twig`` ``default/index.html.twig``
``::layout.html.twig`` ``layout.html.twig``
``AcmeDemoBundle::index.html.twig`` ``index.html.twig``
``AcmeDemoBundle:Default:subdir/index.html.twig`` ``default/subdir/index.html.twig``
``AcmeDemoBundle:Default/subdir:index.html.twig`` ``default/subdir/index.html.twig``
================================================= ==================================

Another advantage is that centralizing your templates simplifies the work
of your designers. They don't need to look for templates in lots of directories
Expand Down
59 changes: 28 additions & 31 deletions book/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ entries? Update the route to have a new ``{page}`` placeholder:
.. code-block:: php-annotations

// src/AppBundle/Controller/BlogController.php

// ...

/**
Expand Down Expand Up @@ -470,7 +470,7 @@ This is done by including it in the ``defaults`` collection:
.. code-block:: php-annotations

// src/AppBundle/Controller/BlogController.php

// ...

/**
Expand Down Expand Up @@ -522,13 +522,13 @@ longer required. The URL ``/blog`` will match this route and the value of
the ``page`` parameter will be set to ``1``. The URL ``/blog/2`` will also
match, giving the ``page`` parameter a value of ``2``. Perfect.

=========== ===== ==========
URL route parameters
=========== ===== ==========
``/blog`` blog {page} = 1
``/blog/1`` blog {page} = 1
``/blog/2`` blog {page} = 2
=========== ===== ==========
=========== ======== ==================
URL Route Parameters
=========== ======== ==================
``/blog`` ``blog`` ``{page}`` = ``1``
``/blog/1`` ``blog`` ``{page}`` = ``1``
``/blog/2`` ``blog`` ``{page}`` = ``2``
=========== ======== ==================

.. caution::

Expand All @@ -555,7 +555,7 @@ Take a quick look at the routes that have been created so far:
.. code-block:: php-annotations

// src/AppBundle/Controller/BlogController.php

// ...
class BlogController extends Controller
{
Expand Down Expand Up @@ -631,13 +631,12 @@ will *never* be matched. Instead, a URL like ``/blog/my-blog-post`` will match
the first route (``blog``) and return a nonsense value of ``my-blog-post``
to the ``{page}`` parameter.

+--------------------+-------+-----------------------+
| URL | route | parameters |
+====================+=======+=======================+
| /blog/2 | blog | {page} = 2 |
+--------------------+-------+-----------------------+
| /blog/my-blog-post | blog | {page} = my-blog-post |
+--------------------+-------+-----------------------+
====================== ======== ===============================
URL Route Parameters
====================== ======== ===============================
``/blog/2`` ``blog`` ``{page}`` = ``2``
``/blog/my-blog-post`` ``blog`` ``{page}`` = ``"my-blog-post"``
====================== ======== ===============================

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

+----------------------+-----------+-------------------------+
| URL | route | parameters |
+======================+===========+=========================+
| /blog/2 | blog | {page} = 2 |
+----------------------+-----------+-------------------------+
| /blog/my-blog-post | blog_show | {slug} = my-blog-post |
+----------------------+-----------+-------------------------+
| /blog/2-my-blog-post | blog_show | {slug} = 2-my-blog-post |
+----------------------+-----------+-------------------------+
======================== ============= ===============================
URL Route Parameters
======================== ============= ===============================
``/blog/2`` ``blog`` ``{page}`` = ``2``
``/blog/my-blog-post`` ``blog_show`` ``{slug}`` = ``my-blog-post``
``/blog/2-my-blog-post`` ``blog_show`` ``{slug}`` = ``2-my-blog-post``
======================== ============= ===============================

.. sidebar:: Earlier Routes always Win

Expand All @@ -738,7 +735,7 @@ URL:
.. code-block:: php-annotations

// src/AppBundle/Controller/MainController.php

// ...
class MainController extends Controller
{
Expand Down Expand Up @@ -795,11 +792,11 @@ For incoming requests, the ``{_locale}`` portion of the URL is matched against
the regular expression ``(en|fr)``.

======= ========================
path parameters
Path Parameters
======= ========================
``/`` {_locale} = en
``/en`` {_locale} = en
``/fr`` {_locale} = fr
``/`` ``{_locale}`` = ``"en"``
``/en`` ``{_locale}`` = ``"en"``
``/fr`` ``{_locale}`` = ``"fr"``
``/es`` *won't match this route*
======= ========================

Expand Down
2 changes: 1 addition & 1 deletion components/class_loader/class_map_generator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ manually. For example, imagine a library with the following directory structure:
These files contain the following classes:

=========================== ================
File Class name
File Class Name
=========================== ================
``library/bar/baz/Boo.php`` ``Acme\Bar\Baz``
--------------------------- ----------------
Expand Down
102 changes: 44 additions & 58 deletions components/form/form_events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,13 @@ The ``FormEvents::PRE_SET_DATA`` event is dispatched at the beginning of the

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

+-----------------+-----------+
| Data type | Value |
+=================+===========+
| Model data | ``null`` |
+-----------------+-----------+
| Normalized data | ``null`` |
+-----------------+-----------+
| View data | ``null`` |
+-----------------+-----------+
=============== ========
Data Type Value
=============== ========
Model data ``null``
Normalized data ``null``
View data ``null``
=============== ========

.. caution::

Expand Down Expand Up @@ -98,15 +96,13 @@ the form.

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

+-----------------+------------------------------------------------------+
| Data type | Value |
+=================+======================================================+
| Model data | Model data injected into ``setData()`` |
+-----------------+------------------------------------------------------+
| Normalized data | Model data transformed using a model transformer |
+-----------------+------------------------------------------------------+
| View data | Normalized data transformed using a view transformer |
+-----------------+------------------------------------------------------+
=============== ====================================================
Data Type Value
=============== ====================================================
Model data Model data injected into ``setData()``
Normalized data Model data transformed using a model transformer
View data Normalized data transformed using a view transformer
=============== ====================================================

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

Expand Down Expand Up @@ -140,15 +136,13 @@ It can be used to:

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

+-----------------+------------------------------------------+
| Data type | Value |
+=================+==========================================+
| Model data | Same as in ``FormEvents::POST_SET_DATA`` |
+-----------------+------------------------------------------+
| Normalized data | Same as in ``FormEvents::POST_SET_DATA`` |
+-----------------+------------------------------------------+
| View data | Same as in ``FormEvents::POST_SET_DATA`` |
+-----------------+------------------------------------------+
=============== ========================================
Data Type Value
=============== ========================================
Model data Same as in ``FormEvents::POST_SET_DATA``
Normalized data Same as in ``FormEvents::POST_SET_DATA``
View data Same as in ``FormEvents::POST_SET_DATA``
=============== ========================================

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

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

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

+-----------------+-------------------------------------------------------------------------------------+
| Data type | Value |
+=================+=====================================================================================+
| Model data | Same as in ``FormEvents::POST_SET_DATA`` |
+-----------------+-------------------------------------------------------------------------------------+
| Normalized data | Data from the request reverse-transformed from the request using a view transformer |
+-----------------+-------------------------------------------------------------------------------------+
| View data | Same as in ``FormEvents::POST_SET_DATA`` |
+-----------------+-------------------------------------------------------------------------------------+
=============== ===================================================================================
Data Type Value
=============== ===================================================================================
Model data Same as in ``FormEvents::POST_SET_DATA``
Normalized data Data from the request reverse-transformed from the request using a view transformer
View data Same as in ``FormEvents::POST_SET_DATA``
=============== ===================================================================================

.. caution::

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

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

+-----------------+---------------------------------------------------------------+
| Data type | Value |
+=================+===============================================================+
| Model data | Normalized data reverse-transformed using a model transformer |
+-----------------+---------------------------------------------------------------+
| Normalized data | Same as in ``FormEvents::POST_SUBMIT`` |
+-----------------+---------------------------------------------------------------+
| View data | Normalized data transformed using a view transformer |
+-----------------+---------------------------------------------------------------+
=============== =============================================================
Data Type Value
=============== =============================================================
Model data Normalized data reverse-transformed using a model transformer
Normalized data Same as in ``FormEvents::POST_SUBMIT``
View data Normalized data transformed using a view transformer
=============== =============================================================

.. caution::

Expand Down Expand Up @@ -242,19 +232,15 @@ processed.

.. _component-form-event-table:

+------------------------+-------------------------------+------------------+
| Name | ``FormEvents`` Constant | Event's data |
+========================+===============================+==================+
| ``form.pre_set_data`` | ``FormEvents::PRE_SET_DATA`` | Model data |
+------------------------+-------------------------------+------------------+
| ``form.post_set_data`` | ``FormEvents::POST_SET_DATA`` | Model data |
+------------------------+-------------------------------+------------------+
| ``form.pre_bind`` | ``FormEvents::PRE_SUBMIT`` | Request data |
+------------------------+-------------------------------+------------------+
| ``form.bind`` | ``FormEvents::SUBMIT`` | Normalized data |
+------------------------+-------------------------------+------------------+
| ``form.post_bind`` | ``FormEvents::POST_SUBMIT`` | View data |
+------------------------+-------------------------------+------------------+
====================== ============================= ===============
Name ``FormEvents`` Constant Event's Data
====================== ============================= ===============
``form.pre_set_data`` ``FormEvents::PRE_SET_DATA`` Model data
``form.post_set_data`` ``FormEvents::POST_SET_DATA`` Model data
``form.pre_bind`` ``FormEvents::PRE_SUBMIT`` Request data
``form.bind`` ``FormEvents::SUBMIT`` Normalized data
``form.post_bind`` ``FormEvents::POST_SUBMIT`` View data
====================== ============================= ===============

.. versionadded:: 2.3
Before Symfony 2.3, ``FormEvents::PRE_SUBMIT``, ``FormEvents::SUBMIT``
Expand Down
25 changes: 10 additions & 15 deletions components/http_kernel/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -575,21 +575,16 @@ each event has their own event object:

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

+-------------------+-------------------------------+-------------------------------------------------------------------------------------+
| Name | ``KernelEvents`` Constant | Argument passed to the listener |
+===================+===============================+=====================================================================================+
| kernel.request | ``KernelEvents::REQUEST`` | :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent` |
+-------------------+-------------------------------+-------------------------------------------------------------------------------------+
| kernel.controller | ``KernelEvents::CONTROLLER`` | :class:`Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent` |
+-------------------+-------------------------------+-------------------------------------------------------------------------------------+
| kernel.view | ``KernelEvents::VIEW`` | :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent` |
+-------------------+-------------------------------+-------------------------------------------------------------------------------------+
| kernel.response | ``KernelEvents::RESPONSE`` | :class:`Symfony\\Component\\HttpKernel\\Event\\FilterResponseEvent` |
+-------------------+-------------------------------+-------------------------------------------------------------------------------------+
| kernel.terminate | ``KernelEvents::TERMINATE`` | :class:`Symfony\\Component\\HttpKernel\\Event\\PostResponseEvent` |
+-------------------+-------------------------------+-------------------------------------------------------------------------------------+
| kernel.exception | ``KernelEvents::EXCEPTION`` | :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent` |
+-------------------+-------------------------------+-------------------------------------------------------------------------------------+
================= ============================ ===================================================================================
Name ``KernelEvents`` Constant Argument Passed to the Listener
================= ============================ ===================================================================================
kernel.request ``KernelEvents::REQUEST`` :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent`
kernel.controller ``KernelEvents::CONTROLLER`` :class:`Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent`
kernel.view ``KernelEvents::VIEW`` :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent`
kernel.response ``KernelEvents::RESPONSE`` :class:`Symfony\\Component\\HttpKernel\\Event\\FilterResponseEvent`
kernel.terminate ``KernelEvents::TERMINATE`` :class:`Symfony\\Component\\HttpKernel\\Event\\PostResponseEvent`
kernel.exception ``KernelEvents::EXCEPTION`` :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent`
================= ============================ ===================================================================================

.. _http-kernel-working-example:

Expand Down
2 changes: 1 addition & 1 deletion contributing/documentation/format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ The previous reST snippet renders as follow:
The current list of supported formats are the following:

=================== ======================================
Markup format Use it to display
Markup Format Use It to Display
=================== ======================================
``html`` HTML
``xml`` XML
Expand Down
6 changes: 3 additions & 3 deletions cookbook/security/entity_provider.rst
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,11 @@ The :class:`Symfony\\Component\\Security\\Core\\User\\AdvancedUserInterface`
interface adds four extra methods to validate the account status:

* :method:`Symfony\\Component\\Security\\Core\\User\\AdvancedUserInterface::isAccountNonExpired`
checks whether the user's account has expired,
checks whether the user's account has expired;
* :method:`Symfony\\Component\\Security\\Core\\User\\AdvancedUserInterface::isAccountNonLocked`
checks whether the user is locked,
checks whether the user is locked;
* :method:`Symfony\\Component\\Security\\Core\\User\\AdvancedUserInterface::isCredentialsNonExpired`
checks whether the user's credentials (password) has expired,
checks whether the user's credentials (password) has expired;
* :method:`Symfony\\Component\\Security\\Core\\User\\AdvancedUserInterface::isEnabled`
checks whether the user is enabled.

Expand Down
10 changes: 6 additions & 4 deletions cookbook/templating/twig_extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@ Now you must let the Service Container know about your newly created Twig Extens
.. note::

Keep in mind that Twig Extensions are not lazily loaded. This means that
there's a higher chance that you'll get a **CircularReferenceException**
or a **ScopeWideningInjectionException** if any services
(or your Twig Extension in this case) are dependent on the request service.
For more information take a look at :doc:`/cookbook/service_container/scopes`.
there's a higher chance that you'll get a
:class:`Symfony\\Component\\DependencyInjection\\Exception\\ServiceCircularReferenceException`
or a
:class:`Symfony\\Component\\DependencyInjection\\Exception\\ScopeWideningInjectionException`
if any services (or your Twig Extension in this case) are dependent on
the request service. For more information take a look at :doc:`/cookbook/service_container/scopes`.

Using the custom Extension
--------------------------
Expand Down
Loading
0