Skip to content

Commit

Permalink
Merge branch '2.7' into 2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Oct 8, 2015
2 parents 6e8d5fc + 9b7fe51 commit f8c9ce3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 4 additions & 2 deletions components/options_resolver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,8 @@ that, you can write normalizers. Normalizers are executed after validating an
option. You can configure a normalizer by calling
:method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::setNormalizer`::

use Symfony\Component\OptionsResolver\Options;

// ...
class Mailer
{
Expand All @@ -436,7 +438,7 @@ option. You can configure a normalizer by calling
{
// ...

$resolver->setNormalizer('host', function ($options, $value) {
$resolver->setNormalizer('host', function (Options $options, $value) {
if ('http://' !== substr($value, 0, 7)) {
$value = 'http://'.$value;
}
Expand All @@ -462,7 +464,7 @@ if you need to use other options during normalization::
public function configureOptions(OptionsResolver $resolver)
{
// ...
$resolver->setNormalizer('host', function ($options, $value) {
$resolver->setNormalizer('host', function (Options $options, $value) {
if (!in_array(substr($value, 0, 7), array('http://', 'https://'))) {
if ('ssl' === $options['encryption']) {
$value = 'https://'.$value;
Expand Down
7 changes: 3 additions & 4 deletions components/routing/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ your autoloader to load the Routing component::

.. note::

Be careful when using ``$_SERVER['REQUEST_URI']``, as it may include
any query parameters on the URL, which will cause problems with route
matching. An easy way to solve this is to use the HttpFoundation component
as explained :ref:`below <components-routing-http-foundation>`.
The :class:`Symfony\\Component\\Routing\\RequestContext` parameters can be populated
with the values stored in ``$_SERVER``, but it's easier to use the HttpFoundation
component as explained :ref:`below <components-routing-http-foundation>`.

You can add as many routes as you like to a
:class:`Symfony\\Component\\Routing\\RouteCollection`.
Expand Down
4 changes: 2 additions & 2 deletions cookbook/controller/upload_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ in the ``Product`` entity::
Note that the type of the ``brochure`` column is ``string`` instead of ``binary``
or ``blob`` because it just stores the PDF file name instead of the file contents.

Then, add a new ``brochure`` field to the form that manage the ``Product`` entity::
Then, add a new ``brochure`` field to the form that manages the ``Product`` entity::

// src/AppBundle/Form/ProductType.php
namespace AppBundle\Form;
Expand Down Expand Up @@ -133,7 +133,7 @@ Finally, you need to update the code of the controller that handles the form::

// Update the 'brochure' property to store the PDF file name
// instead of its contents
$product->setBrochure($filename);
$product->setBrochure($fileName);

// ... persist the $product variable or any other work

Expand Down

0 comments on commit f8c9ce3

Please sign in to comment.