Permalink
Browse files

minor #3899 [RFR] Misc. minor fixes mostly related to formatting issu…

…es (javiereguiluz)

This PR was merged into the 2.3 branch.

Discussion
----------

[RFR] Misc. minor fixes mostly related to formatting issues

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.3+
| Fixed tickets | -

Commits
-------

2442839 Reverted the changes in the numbered lists
d38f00e Fixed a minor indenttation issue
03b83ba Splitted one tip directive into two smaller tips
b223417 Replaced a sidebar with a tip directive
e871a32 Fixed a very minor indentation issue
3b557a0 Fixed the formatting of several lists to avoid problems when rendering the documentation on the website
2deb5d7 Added some links to API methods
6625ff2 Fixed the indentation of a bulleted list
81fe666 Fixed more table headers formatting
314c131 Fixed the indentation of one code block
9a71577 Removed a tip inside a sidebar
4641c66 Fixed the formatting of one table headers
0554cae Fixed some minor formatting issues related to lists
dee3180 Fixed the formating of one table (it now uses proper headers)
00b3d26 Added the suggestions made by the great @wouterj
79bf0a1 Misc. minor fixes mostly related to formatting issues
  • Loading branch information...
weaverryan committed Jun 7, 2014
2 parents 23b51c8 + 2442839 commit 5e0e1196cf1b7735e489b25fe2c2263fea13d8ff
@@ -413,12 +413,12 @@ doesn't replace your existing methods).
With the ``doctrine:generate:entities`` command you can:
* generate getters and setters;
* generate getters and setters;
* generate repository classes configured with the
``@ORM\Entity(repositoryClass="...")`` annotation;
* generate repository classes configured with the
``@ORM\Entity(repositoryClass="...")`` annotation;
* generate the appropriate constructor for 1:n and n:m relations.
* generate the appropriate constructor for 1:n and n:m relations.
The ``doctrine:generate:entities`` command saves a backup of the original
``Product.php`` named ``Product.php~``. In some cases, the presence of
@@ -1034,7 +1034,7 @@ Cache Invalidation
------------------
"There are only two hard things in Computer Science: cache invalidation
and naming things." --Phil Karlton
and naming things." -- Phil Karlton
You should never need to invalidate cached data because invalidation is already
taken into account natively in the HTTP cache models. If you use validation,
@@ -852,8 +852,8 @@ if ``ip``, ``host`` or ``method`` are not specified for an entry, that ``access_
will match any ``ip``, ``host`` or ``method``:
+-----------------+-------------+-------------+------------+--------------------------------+-------------------------------------------------------------+
| **URI** | **IP** | **HOST** | **METHOD** | ``access_control`` | Why? |
+-----------------+-------------+-------------+------------+--------------------------------+-------------------------------------------------------------+
| URI | IP | HOST | METHOD | ``access_control`` | Why? |
+=================+=============+=============+============+================================+=============================================================+
| ``/admin/user`` | 127.0.0.1 | example.com | GET | rule #1 (``ROLE_USER_IP``) | The URI matches ``path`` and the IP matches ``ip``. |
+-----------------+-------------+-------------+------------+--------------------------------+-------------------------------------------------------------+
| ``/admin/user`` | 127.0.0.1 | symfony.com | GET | rule #1 (``ROLE_USER_IP``) | The ``path`` and ``ip`` still match. This would also match |
@@ -75,19 +75,17 @@ to web designers and, in several ways, more powerful than PHP templates:
</body>
</html>
Twig defines two types of special syntax:
Twig defines three types of special syntax:
* ``{{ ... }}``: "Says something": prints a variable or the result of an
expression to the template;
* ``{% ... %}``: "Does something": a **tag** that controls the logic of the
template; it is used to execute statements such as for-loops for example.
.. note::
There is a third syntax used for creating comments: ``{# this is a comment #}``.
This syntax can be used across multiple lines like the PHP-equivalent
``/* comment */`` syntax.
* ``{# ... #}``: "Comment something": it's the equivalent of the PHP
``/* comment */`` syntax. It's used to add single or multi-line comments.
The content of the comments isn't included in the rendered pages.
Twig also contains **filters**, which modify content before being rendered.
The following makes the ``title`` variable all uppercase before rendering
@@ -399,14 +397,14 @@ lives in a specific location:
template for a specific page. The three parts of the string, each separated
by a colon (``:``), mean the following:
* ``AcmeBlogBundle``: (*bundle*) the template lives inside the
``AcmeBlogBundle`` (e.g. ``src/Acme/BlogBundle``);
* ``AcmeBlogBundle``: (*bundle*) the template lives inside the
``AcmeBlogBundle`` (e.g. ``src/Acme/BlogBundle``);
* ``Blog``: (*controller*) indicates that the template lives inside the
``Blog`` subdirectory of ``Resources/views``;
* ``Blog``: (*controller*) indicates that the template lives inside the
``Blog`` subdirectory of ``Resources/views``;
* ``index.html.twig``: (*template*) the actual name of the file is
``index.html.twig``.
* ``index.html.twig``: (*template*) the actual name of the file is
``index.html.twig``.
Assuming that the ``AcmeBlogBundle`` lives at ``src/Acme/BlogBundle``, the
final path to the layout would be ``src/Acme/BlogBundle/Resources/views/Blog/index.html.twig``.
@@ -37,7 +37,7 @@ activate these in the same way as it does for custom handlers.
Symfony2 provides drivers for the following native save handler as an example:
* :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeFileSessionHandler`
* :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeFileSessionHandler`
Example usage::
@@ -242,22 +242,22 @@ will be called after another event - ``kernel.controller`` - is dispatched.
This string is then transformed into a PHP callable by doing the following:
a) The ``AcmeDemoBundle:Default:index`` format of the ``_controller`` key
is changed to another string that contains the full class and method
name of the controller by following the convention used in Symfony2 - e.g.
``Acme\DemoBundle\Controller\DefaultController::indexAction``. This transformation
is specific to the :class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver`
sub-class used by the Symfony2 Framework.
is changed to another string that contains the full class and method
name of the controller by following the convention used in Symfony2 - e.g.
``Acme\DemoBundle\Controller\DefaultController::indexAction``. This transformation
is specific to the :class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver`
sub-class used by the Symfony2 Framework.
b) A new instance of your controller class is instantiated with no
constructor arguments.
constructor arguments.
c) If the controller implements :class:`Symfony\\Component\\DependencyInjection\\ContainerAwareInterface`,
``setContainer`` is called on the controller object and the container
is passed to it. This step is also specific to the :class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver`
sub-class used by the Symfony2 Framework.
``setContainer`` is called on the controller object and the container
is passed to it. This step is also specific to the :class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver`
sub-class used by the Symfony2 Framework.
There are also a few other variations on the above process (e.g. if
you're registering your controllers as services).
There are also a few other variations on the above process (e.g. if
you're registering your controllers as services).
.. _component-http-kernel-kernel-controller:
@@ -325,14 +325,14 @@ of arguments that should be passed when executing that callable.
to determine which value should be passed for each argument:
a) If the ``Request`` attributes bag contains a key that matches the name
of the argument, that value is used. For example, if the first argument
to a controller is ``$slug``, and there is a ``slug`` key in the ``Request``
``attributes`` bag, that value is used (and typically this value came
from the ``RouterListener``).
of the argument, that value is used. For example, if the first argument
to a controller is ``$slug``, and there is a ``slug`` key in the ``Request``
``attributes`` bag, that value is used (and typically this value came
from the ``RouterListener``).
b) If the argument in the controller is type-hinted with Symfony's
:class:`Symfony\\Component\\HttpFoundation\\Request` object, then the
``Request`` is passed in as the value.
:class:`Symfony\\Component\\HttpFoundation\\Request` object, then the
``Request`` is passed in as the value.
.. _component-http-kernel-calling-controller:
@@ -528,20 +528,20 @@ below for more details).
The listener has several goals:
1) The thrown exception is converted into a
:class:`Symfony\\Component\\HttpKernel\\Exception\\FlattenException`
object, which contains all the information about the request, but which
can be printed and serialized.
:class:`Symfony\\Component\\HttpKernel\\Exception\\FlattenException`
object, which contains all the information about the request, but which
can be printed and serialized.
2) If the original exception implements
:class:`Symfony\\Component\\HttpKernel\\Exception\\HttpExceptionInterface`,
then ``getStatusCode`` and ``getHeaders`` are called on the exception
and used to populate the headers and status code of the ``FlattenException``
object. The idea is that these are used in the next step when creating
the final response.
:class:`Symfony\\Component\\HttpKernel\\Exception\\HttpExceptionInterface`,
then ``getStatusCode`` and ``getHeaders`` are called on the exception
and used to populate the headers and status code of the ``FlattenException``
object. The idea is that these are used in the next step when creating
the final response.
3) A controller is executed and passed the flattened exception. The exact
controller to render is passed as a constructor argument to this listener.
This controller will return the final ``Response`` for this error page.
controller to render is passed as a constructor argument to this listener.
This controller will return the final ``Response`` for this error page.
**ExceptionListener in Security**
@@ -570,8 +570,8 @@ each event has their own event object:
.. _component-http-kernel-event-table:
+-------------------+-------------------------------+-------------------------------------------------------------------------------------+
| **Name** | ``KernelEvents`` **Constant** | **Argument passed to the listener** |
+-------------------+-------------------------------+-------------------------------------------------------------------------------------+
| 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` |
@@ -176,17 +176,11 @@ instance, if you want to match both ``m.example.com`` and
return $collection;
.. sidebar:: Using Service Parameters
.. tip::
You can also use service parameters if you do not want to hardcode the
hostname:
.. tip::
Make sure you also include a default option for the ``domain`` placeholder,
otherwise you need to include a domain value each time you generate
a URL using the route.
.. configuration-block::
.. code-block:: yaml
@@ -242,6 +236,12 @@ instance, if you want to match both ``m.example.com`` and
return $collection;
.. tip::
Make sure you also include a default option for the ``domain`` placeholder,
otherwise you need to include a domain value each time you generate
a URL using the route.
.. _component-routing-host-imported:
Using Host Matching of Imported Routes
@@ -289,12 +289,12 @@ Testing your Controllers
You need to set the Host HTTP header on your request objects if you want to get
past url matching in your functional tests.
.. code-block:: php
.. code-block:: php
$crawler = $client->request(
'GET',
'/homepage',
array(),
array(),
array('HTTP_HOST' => 'm.' . $client->getContainer()->getParameter('domain'))
);
$crawler = $client->request(
'GET',
'/homepage',
array(),
array(),
array('HTTP_HOST' => 'm.' . $client->getContainer()->getParameter('domain'))
);
@@ -310,23 +310,23 @@ translation files, use the shorter version of the check-list:
Some answers to the questions trigger some more requirements:
* If you answer yes to "Bug fix?", check if the bug is already listed in the
Symfony issues and reference it/them in "Fixed tickets";
* If you answer yes to "Bug fix?", check if the bug is already listed in the
Symfony issues and reference it/them in "Fixed tickets";
* If you answer yes to "New feature?", you must submit a pull request to the
documentation and reference it under the "Doc PR" section;
* If you answer yes to "New feature?", you must submit a pull request to the
documentation and reference it under the "Doc PR" section;
* If you answer yes to "BC breaks?", the patch must contain updates to the
relevant ``CHANGELOG`` and ``UPGRADE`` files;
* If you answer yes to "BC breaks?", the patch must contain updates to the
relevant ``CHANGELOG`` and ``UPGRADE`` files;
* If you answer yes to "Deprecations?", the patch must contain updates to the
relevant ``CHANGELOG`` and ``UPGRADE`` files;
* If you answer yes to "Deprecations?", the patch must contain updates to the
relevant ``CHANGELOG`` and ``UPGRADE`` files;
* If you answer no to "Tests pass", you must add an item to a todo-list with
the actions that must be done to fix the tests;
* If you answer no to "Tests pass", you must add an item to a todo-list with
the actions that must be done to fix the tests;
* If the "license" is not MIT, just don't submit the pull request as it won't
be accepted anyway.
* If the "license" is not MIT, just don't submit the pull request as it won't
be accepted anyway.
If some of the previous requirements are not met, create a todo-list and add
relevant items:
@@ -287,12 +287,12 @@ The new environment is now accessible via::
.. note::
Some environments, like the ``dev`` environment, are never meant to be
accessed on any deployed server by the general public. This is because
certain environments, for debugging purposes, may give too much information
about the application or underlying infrastructure. To be sure these environments
aren't accessible, the front controller is usually protected from external
IP addresses via the following code at the top of the controller:
Some environments, like the ``dev`` environment, are never meant to be
accessed on any deployed server by the general public. This is because
certain environments, for debugging purposes, may give too much information
about the application or underlying infrastructure. To be sure these environments
aren't accessible, the front controller is usually protected from external
IP addresses via the following code at the top of the controller:
.. code-block:: php
@@ -315,8 +315,12 @@ However, each environment caches its own set of files:
.. code-block:: text
app/cache/dev - cache directory for the *dev* environment
app/cache/prod - cache directory for the *prod* environment
<your-project>/
├─ app/
│ ├─ cache/
│ │ ├─ dev/ # cache directory for the *dev* environment
│ │ └─ prod/ # cache directory for the *prod* environment
│ ├─ ...
Sometimes, when debugging, it may be helpful to inspect a cached file to
understand how something is working. When doing so, remember to look in
@@ -55,13 +55,13 @@ following configuration snippet:
In Apache 2.4, ``Order allow,deny`` has been replaced by ``Require all granted``,
and hence you need to modify your ``Directory`` permission settings as follows:
.. code-block:: apache
.. code-block:: apache
<Directory /var/www/project/web>
# enable the .htaccess rewrites
AllowOverride All
Require all granted
</Directory>
<Directory /var/www/project/web>
# enable the .htaccess rewrites
AllowOverride All
Require all granted
</Directory>
Nginx
-----
Oops, something went wrong.

0 comments on commit 5e0e119

Please sign in to comment.