Skip to content

Commit 78d11d8

Browse files
committed
Merge branch '2.7' into 2.8
Conflicts: reference/configuration/security.rst
2 parents ecc2ca0 + 6971a77 commit 78d11d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+136
-150
lines changed

best_practices/business-logic.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ the class namespace as a parameter:
145145
146146
services:
147147
app.slugger:
148-
class: "%slugger.class%"
148+
class: '%slugger.class%'
149149
150150
This practice is cumbersome and completely unnecessary for your own services:
151151

best_practices/controllers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ configuration to the main routing configuration file:
4343
4444
# app/config/routing.yml
4545
app:
46-
resource: "@AppBundle/Controller/"
46+
resource: '@AppBundle/Controller/'
4747
type: annotation
4848
4949
This configuration will load annotations from any controller stored inside the

book/configuration.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ format you prefer:
2121
- { resource: security.yml }
2222
2323
framework:
24-
secret: "%secret%"
25-
router: { resource: "%kernel.root_dir%/config/routing.yml" }
24+
secret: '%secret%'
25+
router: { resource: '%kernel.root_dir%/config/routing.yml' }
2626
# ...
2727
2828
# Twig Configuration
2929
twig:
30-
debug: "%kernel.debug%"
31-
strict_variables: "%kernel.debug%"
30+
debug: '%kernel.debug%'
31+
strict_variables: '%kernel.debug%'
3232
3333
# ...
3434
@@ -226,7 +226,7 @@ the configuration file for the ``dev`` environment.
226226
- { resource: config.yml }
227227
228228
framework:
229-
router: { resource: "%kernel.root_dir%/config/routing_dev.yml" }
229+
router: { resource: '%kernel.root_dir%/config/routing_dev.yml' }
230230
profiler: { only_exceptions: false }
231231
232232
# ...

book/doctrine.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ information. By convention, this information is usually configured in an
6464
# app/config/config.yml
6565
doctrine:
6666
dbal:
67-
driver: "%database_driver%"
68-
host: "%database_host%"
69-
dbname: "%database_name%"
70-
user: "%database_user%"
71-
password: "%database_password%"
67+
driver: '%database_driver%'
68+
host: '%database_host%'
69+
dbname: '%database_name%'
70+
user: '%database_user%'
71+
password: '%database_password%'
7272
7373
.. code-block:: xml
7474
@@ -162,7 +162,7 @@ for you:
162162
doctrine:
163163
dbal:
164164
driver: pdo_sqlite
165-
path: "%kernel.root_dir%/sqlite.db"
165+
path: '%kernel.root_dir%/sqlite.db'
166166
charset: UTF8
167167
168168
.. code-block:: xml

book/forms.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ controller::
244244

245245
$form->handleRequest($request);
246246

247-
if ($form->isValid()) {
247+
if ($form->isSubmitted() && $form->isValid()) {
248248
// ... perform some action, such as saving the task to the database
249249

250250
return $this->redirectToRoute('task_success');
@@ -1978,4 +1978,4 @@ Learn more from the Cookbook
19781978
.. _`form_div_layout.html.twig`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
19791979
.. _`Cross-site request forgery`: http://en.wikipedia.org/wiki/Cross-site_request_forgery
19801980
.. _`view on GitHub`: https://github.com/symfony/symfony/tree/master/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form
1981-
.. _`2.8 UPGRADE Log`: https://github.com/symfony/symfony/blob/2.8/UPGRADE-2.8.md#form
1981+
.. _`2.8 UPGRADE Log`: https://github.com/symfony/symfony/blob/2.8/UPGRADE-2.8.md#form

book/from_flat_php_to_symfony2.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ the code that prepares the HTML "presentation":
8585

8686
.. code-block:: html+php
8787

88-
<?php
8988
// index.php
9089
$link = mysql_connect('localhost', 'myuser', 'mypassword');
9190
mysql_select_db('blog_db', $link);
@@ -146,7 +145,6 @@ of the application are isolated in a new file called ``model.php``:
146145

147146
.. code-block:: html+php
148147

149-
<?php
150148
// model.php
151149
function open_database_connection()
152150
{
@@ -188,7 +186,6 @@ The controller (``index.php``) is now very simple:
188186

189187
.. code-block:: html+php
190188

191-
<?php
192189
require_once 'model.php';
193190

194191
$posts = get_all_posts();
@@ -280,7 +277,6 @@ page:
280277

281278
.. code-block:: html+php
282279

283-
<?php
284280
require_once 'model.php';
285281

286282
$post = get_post_by_id($_GET['id']);
@@ -361,7 +357,6 @@ on the requested URI:
361357

362358
.. code-block:: html+php
363359

364-
<?php
365360
// index.php
366361

367362
// load and initialize any global libraries
@@ -464,7 +459,6 @@ the HTTP response being returned. Use them to improve the blog:
464459

465460
.. code-block:: html+php
466461

467-
<?php
468462
// index.php
469463
require_once 'vendor/autoload.php';
470464

book/http_fundamentals.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ known as HTTP headers. For example, one important HTTP response header is
149149
``Content-Type``. The body of the same resource could be returned in multiple
150150
different formats like HTML, XML, or JSON and the ``Content-Type`` header uses
151151
Internet Media Types like ``text/html`` to tell the client which format is
152-
being returned. A list of common media types can be found on Wikipedia's
153-
`List of common media types`_ article.
152+
being returned. You can see a `list of common media types`_ from IANA.
154153

155154
Many other headers exist, some of which are very powerful. For example, certain
156155
headers can be used to create a powerful caching system.
@@ -578,6 +577,6 @@ sensible defaults. For more advanced users, the sky is the limit.
578577
.. _`Live HTTP Headers`: https://addons.mozilla.org/en-US/firefox/addon/live-http-headers/
579578
.. _`List of HTTP status codes`: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
580579
.. _`List of HTTP header fields`: https://en.wikipedia.org/wiki/List_of_HTTP_header_fields
581-
.. _`List of common media types`: https://www.iana.org/assignments/media-types/media-types.xhtml
580+
.. _`list of common media types`: https://www.iana.org/assignments/media-types/media-types.xhtml
582581
.. _`Validator`: https://github.com/symfony/validator
583582
.. _`Swift Mailer`: http://swiftmailer.org/

book/page_creation.rst

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@ a method inside of it that will be executed when someone goes to ``/lucky/number
3939
// src/AppBundle/Controller/LuckyController.php
4040
namespace AppBundle\Controller;
4141

42-
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
4342
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
4443
use Symfony\Component\HttpFoundation\Response;
4544

46-
class LuckyController extends Controller
45+
class LuckyController
4746
{
4847
/**
4948
* @Route("/lucky/number")
@@ -104,7 +103,7 @@ Just add a second method to ``LuckyController``::
104103
// src/AppBundle/Controller/LuckyController.php
105104
// ...
106105

107-
class LuckyController extends Controller
106+
class LuckyController
108107
{
109108
// ...
110109

@@ -137,7 +136,7 @@ You can even shorten this with the handy :class:`Symfony\\Component\\HttpFoundat
137136
// --> don't forget this new use statement
138137
use Symfony\Component\HttpFoundation\JsonResponse;
139138

140-
class LuckyController extends Controller
139+
class LuckyController
141140
{
142141
// ...
143142

@@ -170,7 +169,7 @@ at the end:
170169
// src/AppBundle/Controller/LuckyController.php
171170
// ...
172171
173-
class LuckyController extends Controller
172+
class LuckyController
174173
{
175174
/**
176175
* @Route("/lucky/number/{count}")
@@ -224,7 +223,7 @@ The best part is that you can access this value and use it in your controller::
224223
// src/AppBundle/Controller/LuckyController.php
225224
// ...
226225

227-
class LuckyController extends Controller
226+
class LuckyController
228227
{
229228

230229
/**
@@ -478,14 +477,14 @@ is ``app/config/config.yml``:
478477
# ...
479478
480479
framework:
481-
secret: "%secret%"
480+
secret: '%secret%'
482481
router:
483-
resource: "%kernel.root_dir%/config/routing.yml"
482+
resource: '%kernel.root_dir%/config/routing.yml'
484483
# ...
485484
486485
twig:
487-
debug: "%kernel.debug%"
488-
strict_variables: "%kernel.debug%"
486+
debug: '%kernel.debug%'
487+
strict_variables: '%kernel.debug%'
489488
490489
# ...
491490

book/routing.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ file:
164164
# app/config/config.yml
165165
framework:
166166
# ...
167-
router: { resource: "%kernel.root_dir%/config/routing.yml" }
167+
router: { resource: '%kernel.root_dir%/config/routing.yml' }
168168
169169
.. code-block:: xml
170170
@@ -1257,7 +1257,7 @@ configuration:
12571257
12581258
# app/config/routing.yml
12591259
app:
1260-
resource: "@AppBundle/Controller/"
1260+
resource: '@AppBundle/Controller/'
12611261
type: annotation # required to enable the Annotation reader for this resource
12621262
12631263
.. code-block:: xml
@@ -1308,7 +1308,7 @@ directory are parsed and put into the routing.
13081308
13091309
# app/config/routing.yml
13101310
app:
1311-
resource: "@AcmeOtherBundle/Resources/config/routing.yml"
1311+
resource: '@AcmeOtherBundle/Resources/config/routing.yml'
13121312
13131313
.. code-block:: xml
13141314
@@ -1347,7 +1347,7 @@ suppose you want to prefix all routes in the AppBundle with ``/site`` (e.g.
13471347
13481348
# app/config/routing.yml
13491349
app:
1350-
resource: "@AppBundle/Controller/"
1350+
resource: '@AppBundle/Controller/'
13511351
type: annotation
13521352
prefix: /site
13531353

book/service_container.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ parameter and uses it in the service definition.
225225
226226
# app/config/parameters.yml
227227
parameters:
228-
# This will be parsed as string "@securepass"
229-
mailer_password: "@@securepass"
228+
# This will be parsed as string '@securepass'
229+
mailer_password: '@@securepass'
230230
231231
.. note::
232232

@@ -356,7 +356,7 @@ configuration.
356356
357357
# app/config/config.yml
358358
imports:
359-
- { resource: "@AcmeHelloBundle/Resources/config/services.yml" }
359+
- { resource: '@AcmeHelloBundle/Resources/config/services.yml' }
360360
361361
.. code-block:: xml
362362
@@ -433,7 +433,7 @@ invokes the service container extension inside the FrameworkBundle:
433433
secret: xxxxxxxxxx
434434
form: true
435435
csrf_protection: true
436-
router: { resource: "%kernel.root_dir%/config/routing.yml" }
436+
router: { resource: '%kernel.root_dir%/config/routing.yml' }
437437
# ...
438438
439439
.. code-block:: xml

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy