Skip to content

Commit

Permalink
Merge branch '2.7' into 2.8
Browse files Browse the repository at this point in the history
* 2.7:
  Wrap all strings containing @ in quotes in Yaml
  Added a note about the use of _format query parameter
  Always use "main" as the default firewall name (to match Symfony Standard Edition)
  • Loading branch information
weaverryan committed Nov 30, 2015
2 parents 40a52c8 + 7b4c2b0 commit 8d61eb6
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 24 deletions.
20 changes: 14 additions & 6 deletions book/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1104,12 +1104,20 @@ a slash. URLs matching this route might look like:

This example also highlights the special ``_format`` routing parameter.
When using this parameter, the matched value becomes the "request format"
of the ``Request`` object. Ultimately, the request format is used for such
things as setting the ``Content-Type`` of the response (e.g. a ``json``
request format translates into a ``Content-Type`` of ``application/json``).
It can also be used in the controller to render a different template for
each value of ``_format``. The ``_format`` parameter is a very powerful way
to render the same content in different formats.
of the ``Request`` object.

Ultimately, the request format is used for such things as setting the
``Content-Type`` of the response (e.g. a ``json`` request format translates
into a ``Content-Type`` of ``application/json``). It can also be used in the
controller to render a different template for each value of ``_format``.
The ``_format`` parameter is a very powerful way to render the same content
in different formats.

In Symfony versions previous to 3.0, it is possible to override the request
format by adding a query parameter named ``_format`` (for example:
``/foo/bar?_format=json``). Relying on this behavior not only is considered
a bad practice but it will complicate the upgrade of your applications to
Symfony 3.

.. note::

Expand Down
2 changes: 1 addition & 1 deletion cookbook/bundles/best_practices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ The end user can provide values in any configuration file:
# app/config/config.yml
parameters:
acme_blog.author.email: fabien@example.com
acme_blog.author.email: "fabien@example.com"
.. code-block:: xml
Expand Down
2 changes: 1 addition & 1 deletion cookbook/email/dev_environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ via the ``delivery_address`` option:
# app/config/config_dev.yml
swiftmailer:
delivery_address: dev@example.com
delivery_address: "dev@example.com"
.. code-block:: xml
Expand Down
10 changes: 5 additions & 5 deletions cookbook/logging/monolog_email.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ it is broken down.
handler: swift
swift:
type: swift_mailer
from_email: error@example.com
to_email: error@example.com
from_email: "error@example.com"
to_email: "error@example.com"
# or list of recipients
# to_email: [dev1@example.com, dev2@example.com, ...]
# to_email: ["dev1@example.com", "dev2@example.com", ...]
subject: An Error Occurred!
level: debug
Expand Down Expand Up @@ -161,8 +161,8 @@ get logged on the server as well as the emails being sent:
handler: swift
swift:
type: swift_mailer
from_email: error@example.com
to_email: error@example.com
from_email: "error@example.com"
to_email: "error@example.com"
subject: An Error Occurred!
level: debug
Expand Down
6 changes: 3 additions & 3 deletions cookbook/security/entity_provider.rst
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ the username and then check the password (more on passwords in a moment):
# manager_name: customer
firewalls:
default:
main:
pattern: ^/
http_basic: ~
provider: our_db_provider
Expand Down Expand Up @@ -244,7 +244,7 @@ the username and then check the password (more on passwords in a moment):
<entity class="AppBundle:User" property="username" />
</provider>
<firewall name="default" pattern="^/" provider="our_db_provider">
<firewall name="main" pattern="^/" provider="our_db_provider">
<http-basic />
</firewall>
Expand Down Expand Up @@ -273,7 +273,7 @@ the username and then check the password (more on passwords in a moment):
),
),
'firewalls' => array(
'default' => array(
'main' => array(
'pattern' => '^/',
'http_basic' => null,
'provider' => 'our_db_provider',
Expand Down
6 changes: 3 additions & 3 deletions cookbook/security/form_login_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ First, enable form login under your firewall:
# ...
firewalls:
default:
main:
anonymous: ~
form_login:
login_path: /login
Expand All @@ -40,7 +40,7 @@ First, enable form login under your firewall:
http://symfony.com/schema/dic/services/services-1.0.xsd">
<config>
<firewall name="default">
<firewall name="main">
<anonymous />
<form-login login-path="/login" check-path="/login_check" />
</firewall>
Expand All @@ -52,7 +52,7 @@ First, enable form login under your firewall:
// app/config/security.php
$container->loadFromExtension('security', array(
'firewalls' => array(
'default' => array(
'main' => array(
'anonymous' => null,
'form_login' => array(
'login_path' => '/login',
Expand Down
6 changes: 3 additions & 3 deletions cookbook/security/remember_me.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ the session lasts using a cookie with the ``remember_me`` firewall option:
# ...
firewalls:
default:
main:
# ...
remember_me:
secret: "%secret%"
Expand All @@ -43,7 +43,7 @@ the session lasts using a cookie with the ``remember_me`` firewall option:
<config>
<!-- ... -->
<firewall name="default">
<firewall name="main">
<!-- ... -->
<!-- 604800 is 1 week in seconds -->
Expand All @@ -65,7 +65,7 @@ the session lasts using a cookie with the ``remember_me`` firewall option:
// ...
'firewalls' => array(
'default' => array(
'main' => array(
// ...
'remember_me' => array(
'secret' => '%secret%',
Expand Down
4 changes: 2 additions & 2 deletions cookbook/symfony1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ used them in your application:
# some app.yml file from symfony1
all:
email:
from_address: foo.bar@example.com
from_address: "foo.bar@example.com"
In Symfony2, you can also create arbitrary entries under the ``parameters``
key of your configuration:
Expand All @@ -341,7 +341,7 @@ key of your configuration:
.. code-block:: yaml
parameters:
email.from_address: foo.bar@example.com
email.from_address: "foo.bar@example.com"
.. code-block:: xml
Expand Down

0 comments on commit 8d61eb6

Please sign in to comment.