Skip to content

Commit 4240817

Browse files
committed
Merge branch '2.8' into 3.1
Conflicts: configuration.rst service_container/alias_private.rst service_container/shared.rst templating.rst
2 parents ee2ab69 + 8120c70 commit 4240817

16 files changed

+84
-59
lines changed

best_practices/business-logic.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Inside here, you can create whatever directories you want to organize things:
1515

1616
.. code-block:: text
1717
18-
symfony2-project/
18+
symfony-project/
1919
├─ app/
2020
├─ src/
2121
│ └─ AppBundle/
@@ -35,7 +35,7 @@ and put things there:
3535

3636
.. code-block:: text
3737
38-
symfony2-project/
38+
symfony-project/
3939
├─ app/
4040
├─ src/
4141
│ ├─ Acme/
@@ -180,7 +180,7 @@ The three entities defined by our sample blog application are a good example:
180180

181181
.. code-block:: text
182182
183-
symfony2-project/
183+
symfony-project/
184184
├─ ...
185185
└─ src/
186186
└─ AppBundle/

best_practices/controllers.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ it more difficult to know which template is being rendered. It also makes
8585
it less obvious to beginners that a controller should always return a Response
8686
object (unless you're using a view layer).
8787

88-
How the Controller Looks
89-
------------------------
88+
What does the Controller look like
89+
----------------------------------
9090

91-
Considering all this, here is an example of how the controller should look
91+
Considering all this, here is an example of what the controller should look like
9292
for the homepage of our app:
9393

9494
.. code-block:: php

components/expression_language.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ How can the Expression Engine Help Me?
2121
--------------------------------------
2222

2323
The purpose of the component is to allow users to use expressions inside
24-
configuration for more complex logic. For some examples, the Symfony2 Framework
24+
configuration for more complex logic. For some examples, the Symfony Framework
2525
uses expressions in security, for validation rules and in route matching.
2626

2727
Besides using the component in the framework itself, the ExpressionLanguage

components/filesystem.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ On POSIX filesystems, directories are created with a default mode value
6060
You can pass an array or any :phpclass:`Traversable` object as the first
6161
argument.
6262

63+
.. note::
64+
65+
This function ignores already existing directories.
66+
6367
exists
6468
~~~~~~
6569

components/yaml/yaml_format.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ YAML uses the ISO-8601 standard to express dates:
158158

159159
.. code-block:: yaml
160160
161-
2001-12-14t21:59:43.10-05:00
161+
2001-12-14T21:59:43.10-05:00
162162
163163
.. code-block:: yaml
164164

configuration.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,14 @@ There are *two* ways to know *what* keys you can configure:
112112

113113
#. Use the :doc:`Reference Section </reference/index>`;
114114

115-
#. Use the ``config:dump`` command;
115+
#. Use the ``config:dump-reference`` command.
116116

117117
For example, if you want to configure something in Twig, you can see an example
118118
dump of all available configuration options by running:
119119

120120
.. code-block:: terminal
121121
122-
$ php bin/console config:dump twig
122+
$ php bin/console config:dump-reference twig
123123
124124
.. index::
125125
single: Environments; Introduction
@@ -183,7 +183,7 @@ can also load XML files or PHP files.
183183

184184
.. _config-parameter-intro:
185185

186-
The parameters key: Parameters (Variables)
186+
The parameters Key: Parameters (Variables)
187187
------------------------------------------
188188

189189
Another special key is called ``parameters``: it's used to define *variables* that

controller.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ object. To get it in your controller, just add it as an argument and
320320

321321
use Symfony\Component\HttpFoundation\Request;
322322

323-
public function indexAction($firstName, $lastName, Request $request)
323+
public function indexAction(Request $request, $firstName, $lastName)
324324
{
325325
$page = $request->query->get('page', 1);
326326

form/form_dependencies.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ Next, register this as a service and tag it with ``form.type``:
101101
services:
102102
app.form.type.task:
103103
class: AppBundle\Form\TaskType
104+
arguments: ['@doctrine.orm.entity_manager']
104105
tags:
105106
- { name: form.type }
106107
@@ -114,6 +115,7 @@ Next, register this as a service and tag it with ``form.type``:
114115
115116
<services>
116117
<service id="app.form.type.task" class="AppBundle\Form\TaskType">
118+
<argument type="service" id="doctrine.orm.entity_manager"/>
117119
<tag name="form.type" />
118120
</service>
119121
</services>
@@ -127,6 +129,7 @@ Next, register this as a service and tag it with ``form.type``:
127129
'app.form.type.task',
128130
'AppBundle\Form\TaskType'
129131
)
132+
->addArgument('@doctrine.orm.entity_manager')
130133
->addTag('form.type')
131134
;
132135

reference/configuration/framework.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Configuration
100100
* :ref:`enabled <reference-serializer-enabled>`
101101
* :ref:`cache <reference-serializer-cache>`
102102
* :ref:`enable_annotations <reference-serializer-enable_annotations>`
103-
* `name_converter`_
103+
* :ref:`name_converter <reference-serializer-name_converter>`
104104

105105
secret
106106
~~~~~~
@@ -1404,11 +1404,16 @@ If this option is enabled, serialization groups can be defined using annotations
14041404

14051405
For more information, see :ref:`serializer-using-serialization-groups-annotations`.
14061406

1407+
.. _reference-serializer-name_converter:
1408+
14071409
name_converter
14081410
..............
14091411

14101412
**type**: ``string``
14111413

1414+
.. versionadded:: 2.8
1415+
The ``name_converter`` option was introduced in Symfony 2.8.
1416+
14121417
The name converter to use.
14131418
The :class:`Symfony\\Component\\Serializer\\NameConverter\\CamelCaseToSnakeCaseNameConverter`
14141419
name converter can enabled by using the ``serializer.name_converter.camel_case_to_snake_case``

routing.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Thanks to these two routes:
120120

121121
* If the user goes to ``/blog/*``, the second route is matched and ``showAction()``
122122
is executed. Because the route path is ``/blog/{slug}``, a ``$slug`` variable is
123-
passed to ``showAction`` matching that value. For example, if the user goes to
123+
passed to ``showAction()`` matching that value. For example, if the user goes to
124124
``/blog/yay-routing``, then ``$slug`` will equal ``yay-routing``.
125125

126126
Whenever you have a ``{placeholder}`` in your route path, that portion becomes a
@@ -363,7 +363,7 @@ With all of this in mind, check out this advanced example:
363363
{
364364
/**
365365
* @Route(
366-
* "/articles/{_locale}/{year}/{title}.{_format}",
366+
* "/articles/{_locale}/{year}/{slug}.{_format}",
367367
* defaults={"_format": "html"},
368368
* requirements={
369369
* "_locale": "en|fr",
@@ -372,7 +372,7 @@ With all of this in mind, check out this advanced example:
372372
* }
373373
* )
374374
*/
375-
public function showAction($_locale, $year, $title)
375+
public function showAction($_locale, $year, $slug)
376376
{
377377
}
378378
}
@@ -381,7 +381,7 @@ With all of this in mind, check out this advanced example:
381381
382382
# app/config/routing.yml
383383
article_show:
384-
path: /articles/{_locale}/{year}/{title}.{_format}
384+
path: /articles/{_locale}/{year}/{slug}.{_format}
385385
defaults: { _controller: AppBundle:Article:show, _format: html }
386386
requirements:
387387
_locale: en|fr
@@ -398,7 +398,7 @@ With all of this in mind, check out this advanced example:
398398
http://symfony.com/schema/routing/routing-1.0.xsd">
399399
400400
<route id="article_show"
401-
path="/articles/{_locale}/{year}/{title}.{_format}">
401+
path="/articles/{_locale}/{year}/{slug}.{_format}">
402402
403403
<default key="_controller">AppBundle:Article:show</default>
404404
<default key="_format">html</default>
@@ -418,7 +418,7 @@ With all of this in mind, check out this advanced example:
418418
$collection = new RouteCollection();
419419
$collection->add(
420420
'article_show',
421-
new Route('/articles/{_locale}/{year}/{title}.{_format}', array(
421+
new Route('/articles/{_locale}/{year}/{slug}.{_format}', array(
422422
'_controller' => 'AppBundle:Article:show',
423423
'_format' => 'html',
424424
), array(
@@ -502,11 +502,11 @@ The pattern has three parts, each separated by a colon:
502502

503503
For example, a ``_controller`` value of ``AppBundle:Blog:show`` means:
504504

505-
============= ================== ==============
505+
============= ================== ================
506506
Bundle Controller Class Method Name
507-
============= ================== ==============
508-
``AppBundle`` ``BlogController`` ``showAction``
509-
============= ================== ==============
507+
============= ================== ================
508+
``AppBundle`` ``BlogController`` ``showAction()``
509+
============= ================== ================
510510

511511
The controller might look like this::
512512

@@ -524,7 +524,7 @@ The controller might look like this::
524524
}
525525

526526
Notice that Symfony adds the string ``Controller`` to the class name (``Blog``
527-
=> ``BlogController``) and ``Action`` to the method name (``show`` => ``showAction``).
527+
=> ``BlogController``) and ``Action`` to the method name (``show`` => ``showAction()``).
528528

529529
You could also refer to this controller using its fully-qualified class name
530530
and method: ``AppBundle\Controller\BlogController::showAction``. But if you

serializer.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,12 @@ A service leveraging `APCu`_ (and APC for PHP < 5.5) is built-in.
225225
Enabling a Name Converter
226226
-------------------------
227227

228+
.. versionadded:: 2.8
229+
The ``name_converter`` option was introduced in Symfony 2.8.
230+
228231
The use of a :ref:`name converter <component-serializer-converting-property-names-when-serializing-and-deserializing>`
229-
service can be defined in the configuration using the ``name_converter``
230-
serializer parameter.
232+
service can be defined in the configuration using the :ref:`name_converter <reference-serializer-name_converter>`
233+
option.
231234

232235
The built-in :ref:`CamelCase to snake_case name converter <using-camelized-method-names-for-underscored-attributes>`
233236
can be enabled by using the ``serializer.name_converter.camel_case_to_snake_case``

service_container/service_decoration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ the original service is lost:
1818
# this replaces the old app.mailer definition with the new one, the
1919
# old definition is lost
2020
app.mailer:
21-
class AppBundle\DecoratingMailer
21+
class: AppBundle\DecoratingMailer
2222
2323
.. code-block:: xml
2424

setup.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ optional second argument of the ``new`` command:
9696
# use the most recent 'lts' version (Long Term Support version)
9797
$ symfony new my_project_name lts
9898
99+
Each version has its *own* documentation, which you can select on any documentation
100+
page.
101+
99102
.. note::
100103

101104
Read the :doc:`Symfony Release process </contributing/community/releases>`
@@ -294,7 +297,7 @@ Go Deeper with Setup
294297
.. _`Phar extension`: http://php.net/manual/en/intro.phar.php
295298
.. _`Symfony Standard Edition`: https://github.com/symfony/symfony-standard
296299
.. _`The Symfony Demo application`: https://github.com/symfony/symfony-demo
297-
.. _`The Symfony CMF Standard Edition`: https://github.com/symfony-cmf/symfony-cmf-standard
300+
.. _`The Symfony CMF Standard Edition`: https://github.com/symfony-cmf/standard-edition
298301
.. _`Symfony CMF`: http://cmf.symfony.com/
299302
.. _`The Symfony REST Edition`: https://github.com/gimler/symfony-rest-edition
300303
.. _`FOSRestBundle`: https://github.com/FriendsOfSymfony/FOSRestBundle

setup/bundles.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,13 @@ adding a ``setDefined()`` method. The recommended check in this case would be::
189189
// code for the new OptionsResolver API
190190
}
191191

192+
.. tip::
193+
194+
There is one case when you actually can rely on the
195+
``Symfony\Component\HttpKernel\Kernel::VERSION_ID`` constant: when trying
196+
to detect the version of the ``symfony/http-kernel`` component, because it
197+
is the component where this constant is defined.
198+
192199
.. _`symfony/phpunit-bridge package`: https://github.com/symfony/phpunit-bridge
193200
.. _`Official Symfony Guide to Upgrade from 2.x to 3.0`: https://github.com/symfony/symfony/blob/2.8/UPGRADE-3.0.md
194201
.. _`SensioLabs DeprecationDetector`: https://github.com/sensiolabs-de/deprecation-detector

0 commit comments

Comments
 (0)