Skip to content

Commit 8120c70

Browse files
committed
Merge branch '2.7' into 2.8
Conflicts: form/form_dependencies.rst templating.rst
2 parents ac678c8 + 79b59a0 commit 8120c70

File tree

15 files changed

+75
-58
lines changed

15 files changed

+75
-58
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/
@@ -33,7 +33,7 @@ and put things there:
3333

3434
.. code-block:: text
3535
36-
symfony2-project/
36+
symfony-project/
3737
├─ app/
3838
├─ src/
3939
│ ├─ Acme/
@@ -176,7 +176,7 @@ The three entities defined by our sample blog application are a good example:
176176

177177
.. code-block:: text
178178
179-
symfony2-project/
179+
symfony-project/
180180
├─ ...
181181
└─ src/
182182
└─ 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
@@ -64,6 +64,10 @@ On POSIX filesystems, directories are created with a default mode value
6464
You can pass an array or any :phpclass:`Traversable` object as the first
6565
argument.
6666

67+
.. note::
68+
69+
This function ignores already existing directories.
70+
6771
exists
6872
~~~~~~
6973

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 app/console config:dump twig
122+
$ php app/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
@@ -328,7 +328,7 @@ object. To get it in your controller, just add it as an argument and
328328

329329
use Symfony\Component\HttpFoundation\Request;
330330

331-
public function indexAction($firstName, $lastName, Request $request)
331+
public function indexAction(Request $request, $firstName, $lastName)
332332
{
333333
$page = $request->query->get('page', 1);
334334

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

page_creation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ to creating a page?
8181
#. *Create a controller*: The method below the route - ``numberAction()`` - is called
8282
the *controller*: this is a function where *you* build the page and ultimately
8383
return a ``Response`` object. You'll learn more about :doc:`controllers </controller>`
84-
in their own section, including how to return JSON responses;
84+
in their own section, including how to return JSON responses.
8585

8686
The Web Debug Toolbar: Debugging Dream
8787
--------------------------------------
@@ -129,7 +129,7 @@ variable so we can render that::
129129
$number = mt_rand(0, 100);
130130

131131
return $this->render('lucky/number.html.twig', array(
132-
'number' => $number
132+
'number' => $number,
133133
));
134134
}
135135
}

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

0 commit comments

Comments
 (0)