diff --git a/book/templating.rst b/book/templating.rst index cfc6a1414e8..f04fc656a48 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -1523,9 +1523,9 @@ In many cases, you may want to allow a single controller to render multiple different formats based on the "request format". For that reason, a common pattern is to do the following:: - public function indexAction() + public function indexAction(Request $request) { - $format = $this->getRequest()->getRequestFormat(); + $format = $request->getRequestFormat(); return $this->render('AcmeBlogBundle:Blog:index.'.$format.'.twig'); } diff --git a/contributing/documentation/standards.rst b/contributing/documentation/standards.rst index 821252113bf..57cd8933c4c 100644 --- a/contributing/documentation/standards.rst +++ b/contributing/documentation/standards.rst @@ -81,25 +81,6 @@ Configuration examples should show all supported formats using * **Validation**: YAML, Annotations, XML, PHP * **Doctrine Mapping**: Annotations, YAML, XML, PHP -Files and Directories -~~~~~~~~~~~~~~~~~~~~~ - -* When referencing directories, always add a trailing slash to avoid confusions - with regular files (e.g. *"execute the ``console`` script located at the ``app/`` - directory"*). -* When referencing file extensions explicitly, you should include a leading dot - for every extension (e.g. "*XML files use the ``.xml`` extension*"). -* When you list a Symfony file/directory hierarchy, use ``your-project/`` as the - top level directory. E.g. - - .. code-block:: text - - your-project/ - ├─ app/ - ├─ src/ - ├─ vendor/ - └─ ... - Example ~~~~~~~ @@ -133,6 +114,25 @@ Example In YAML you should put a space after ``{`` and before ``}`` (e.g. ``{ _controller: ... }``), but this should not be done in Twig (e.g. ``{'hello' : 'value'}``). +Files and Directories +--------------------- + +* When referencing directories, always add a trailing slash to avoid confusions + with regular files (e.g. "execute the ``console`` script located at the ``app/`` + directory"). +* When referencing file extensions explicitly, you should include a leading dot + for every extension (e.g. "XML files use the ``.xml`` extension"). +* When you list a Symfony file/directory hierarchy, use ``your-project/`` as the + top level directory. E.g. + + .. code-block:: text + + your-project/ + ├─ app/ + ├─ src/ + ├─ vendor/ + └─ ... + Language Standards ------------------ diff --git a/cookbook/configuration/override_dir_structure.rst b/cookbook/configuration/override_dir_structure.rst index b3d73241b93..c46bd5f11cf 100644 --- a/cookbook/configuration/override_dir_structure.rst +++ b/cookbook/configuration/override_dir_structure.rst @@ -10,18 +10,19 @@ directory structure is: .. code-block:: text - app/ - cache/ - config/ - logs/ - ... - src/ - ... - vendor/ - ... - web/ - app.php - ... + your-project/ + ├─ app/ + │ ├─ cache/ + │ ├─ config/ + │ ├─ logs/ + │ └─ ... + ├─ src/ + │ └─ ... + ├─ vendor/ + │ └─ ... + └─ web/ + ├─ app.php + └─ ... .. _override-cache-dir: @@ -94,7 +95,7 @@ may need to modify the paths inside these files:: You also need to change the ``extra.symfony-web-dir`` option in the ``composer.json`` file: -.. code-block:: json +.. code-block:: javascript { ... diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index 9c9b959123a..d1a25c75a39 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -411,3 +411,38 @@ Each connection is also accessible via the ``doctrine.dbal.[name]_connection`` service where ``[name]`` is the name of the connection. .. _DBAL documentation: http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html + +Shortened Configuration Syntax +------------------------------ + +When you are only using one entity manager, all config options available +can be placed directly under ``doctrine.orm`` config level. + +.. code-block:: yaml + + doctrine: + orm: + # ... + query_cache_driver: + # ... + metadata_cache_driver: + # ... + result_cache_driver: + # ... + connection: ~ + class_metadata_factory_name: Doctrine\ORM\Mapping\ClassMetadataFactory + default_repository_class: Doctrine\ORM\EntityRepository + auto_mapping: false + hydrators: + # ... + mappings: + # ... + dql: + # ... + filters: + # ... + +This shortened version is commonly used in other documentation sections. +Keep in mind that you can't use both syntaxes at the same time. + +.. _`DQL User Defined Functions`: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/dql-user-defined-functions.html diff --git a/reference/forms/types/options/pattern.rst.inc b/reference/forms/types/options/pattern.rst.inc index 65c3870961a..a7bd1d1aaaf 100644 --- a/reference/forms/types/options/pattern.rst.inc +++ b/reference/forms/types/options/pattern.rst.inc @@ -11,13 +11,13 @@ pattern This adds an HTML5 ``pattern`` attribute to restrict the field input by a given regular expression. -.. caution: +.. caution:: The ``pattern`` attribute provides client-side validation for convenience purposes only and must not be used as a replacement for reliable server-side validation. -.. note: +.. note:: When using validation constraints, this option is set automatically for some constraints to match the server-side validation. diff --git a/reference/forms/types/options/post_max_size_message.rst.inc b/reference/forms/types/options/post_max_size_message.rst.inc index f85cb83a99d..9378edb4941 100644 --- a/reference/forms/types/options/post_max_size_message.rst.inc +++ b/reference/forms/types/options/post_max_size_message.rst.inc @@ -7,6 +7,6 @@ This is the validation error message that's used if submitted POST form data exceeds ``php.ini``'s ``post_max_size`` directive. The ``{{ max }}`` placeholder can be used to display the allowed size. -.. note: +.. note:: Validating the ``post_max_size`` only happens on the root form.