Skip to content

Commit 780cd22

Browse files
committed
Merge branch '2.3' into 2.4
2 parents a5d1539 + 0428c57 commit 780cd22

File tree

14 files changed

+76
-39
lines changed

14 files changed

+76
-39
lines changed

book/forms.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,8 @@ that will house the logic for building the task form::
10061006
{
10071007
public function buildForm(FormBuilderInterface $builder, array $options)
10081008
{
1009-
$builder->add('task')
1009+
$builder
1010+
->add('task')
10101011
->add('dueDate', null, array('widget' => 'single_text'))
10111012
->add('save', 'submit');
10121013
}

book/page_creation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ an entry when you generated the ``AcmeHelloBundle``:
165165
$collection = new RouteCollection();
166166
$collection->addCollection(
167167
$loader->import('@AcmeHelloBundle/Resources/config/routing.php'),
168-
'/',
168+
'/'
169169
);
170170
171171
return $collection;

book/routing.rst

+10-8
Original file line numberDiff line numberDiff line change
@@ -562,13 +562,15 @@ is *not* a number).
562562
As a result, a URL like ``/blog/my-blog-post`` will now properly match the
563563
``blog_show`` route.
564564

565-
+--------------------+-----------+-----------------------+
566-
| URL | route | parameters |
567-
+====================+===========+=======================+
568-
| /blog/2 | blog | {page} = 2 |
569-
+--------------------+-----------+-----------------------+
570-
| /blog/my-blog-post | blog_show | {slug} = my-blog-post |
571-
+--------------------+-----------+-----------------------+
565+
+----------------------+-----------+-------------------------+
566+
| URL | route | parameters |
567+
+======================+===========+=========================+
568+
| /blog/2 | blog | {page} = 2 |
569+
+----------------------+-----------+-------------------------+
570+
| /blog/my-blog-post | blog_show | {slug} = my-blog-post |
571+
+----------------------+-----------+-------------------------+
572+
| /blog/2-my-blog-post | blog_show | {slug} = 2-my-blog-post |
573+
+----------------------+-----------+-------------------------+
572574

573575
.. sidebar:: Earlier Routes always Win
574576

@@ -1142,7 +1144,7 @@ instead of simply ``/hello/{name}``:
11421144
$acmeHello = $loader->import(
11431145
"@AcmeHelloBundle/Resources/config/routing.php"
11441146
);
1145-
$acmeHello->setPrefix('/admin');
1147+
$acmeHello->addPrefix('/admin');
11461148
11471149
$collection->addCollection($acmeHello);
11481150

book/validation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ section .
11481148
The ``validateValue`` method returns a :class:`Symfony\\Component\\Validator\\ConstraintViolationList`
11491149
object, which acts just like an array of errors. Each error in the collection
11501150
is a :class:`Symfony\\Component\\Validator\\ConstraintViolation` object,
1151-
which holds the error message on its `getMessage` method.
1151+
which holds the error message on its ``getMessage`` method.
11521152

11531153
Final Thoughts
11541154
--------------

components/dependency_injection/factories.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ factory itself as a service:
125125
126126
$container->setDefinition('newsletter_factory', new Definition(
127127
'%newsletter_factory.class%'
128-
))
128+
));
129129
$container->setDefinition('newsletter_manager', new Definition(
130130
'%newsletter_manager.class%'
131131
))->setFactoryService(
@@ -193,7 +193,7 @@ in the previous example takes the ``templating`` service as an argument:
193193
194194
$container->setDefinition('newsletter_factory', new Definition(
195195
'%newsletter_factory.class%'
196-
))
196+
));
197197
$container->setDefinition('newsletter_manager', new Definition(
198198
'%newsletter_manager.class%',
199199
array(new Reference('templating'))

components/form/introduction.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ object to read data off of the correct PHP superglobals (i.e. ``$_POST`` or
8484
:class:`Symfony\\Component\\Form\\Extension\\HttpFoundation\\HttpFoundationExtension`
8585
to your form factory::
8686

87-
use Symfony\Component\Form\Forms;
88-
use Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationExtension;
87+
use Symfony\Component\Form\Forms;
88+
use Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationExtension;
8989

90-
$formFactory = Forms::createFormFactoryBuilder()
91-
->addExtension(new HttpFoundationExtension())
92-
->getFormFactory();
90+
$formFactory = Forms::createFormFactoryBuilder()
91+
->addExtension(new HttpFoundationExtension())
92+
->getFormFactory();
9393

9494
Now, when you process a form, you can pass the :class:`Symfony\\Component\\HttpFoundation\\Request`
9595
object to :method:`Symfony\\Component\\Form\\Form::handleRequest`::

cookbook/bundles/remove.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ starting a project, but you'll probably want to eventually remove it.
1717
---------------------------------------------
1818

1919
To disconnect the bundle from the framework, you should remove the bundle from
20-
the ``Appkernel::registerBundles()`` method. The bundle is normally found in
20+
the ``AppKernel::registerBundles()`` method. The bundle is normally found in
2121
the ``$bundles`` array but the AcmeDemoBundle is only registered in a
2222
development environment and you can find him in the if statement after::
2323

cookbook/console/logging.rst

+7-5
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ container and use it to do the logging::
3434
use Symfony\Component\Console\Input\InputInterface;
3535
use Symfony\Component\Console\Input\InputOption;
3636
use Symfony\Component\Console\Output\OutputInterface;
37-
use \Psr\Log\LoggerInterface;
37+
use Psr\Log\LoggerInterface;
3838

3939
class GreetCommand extends ContainerAwareCommand
4040
{
@@ -150,7 +150,8 @@ Then implement the actual listener::
150150
$this->logger = $logger;
151151
}
152152

153-
public function onConsoleException(ConsoleExceptionEvent $event) {
153+
public function onConsoleException(ConsoleExceptionEvent $event)
154+
{
154155
$command = $event->getCommand();
155156
$exception = $event->getException();
156157

@@ -170,7 +171,7 @@ Then implement the actual listener::
170171
In the code above, when any command throws an exception, the listener will
171172
receive an event. You can simply log it by passing the logger service via the
172173
service configuration. Your method receives a
173-
:class:`Symfony\\Component\\Console\\Event\\ConsoleExceptionEvent`` object,
174+
:class:`Symfony\\Component\\Console\\Event\\ConsoleExceptionEvent` object,
174175
which has methods to get information about the event and the exception.
175176

176177
Logging non-0 exit statuses
@@ -241,7 +242,7 @@ First configure a listener for console terminate events in the service container
241242
Then implement the actual listener::
242243

243244
// src/Acme/DemoBundle/EventListener/ConsoleExceptionListener.php
244-
namespace Acme/DemoBundle\EventListener;
245+
namespace Acme\DemoBundle\EventListener;
245246

246247
use Symfony\Component\Console\Event\ConsoleTerminateEvent;
247248
use Psr\Log\LoggerInterface;
@@ -255,7 +256,8 @@ Then implement the actual listener::
255256
$this->logger = $logger;
256257
}
257258

258-
public function onConsoleTerminate(ConsoleTerminateEvent $event) {
259+
public function onConsoleTerminate(ConsoleTerminateEvent $event)
260+
{
259261
$statusCode = $event->getExitCode();
260262
$command = $event->getCommand();
261263

cookbook/form/dynamic_form_modification.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ Adding an Event Subscriber to a Form Class
168168

169169
For better reusability or if there is some heavy logic in your event listener,
170170
you can also move the logic for creating the ``name`` field to an
171-
:ref:`event subscriber <event_dispatcher-using-event-subscribers:ref:>`::
171+
:ref:`event subscriber <event_dispatcher-using-event-subscribers>`::
172172

173173
// src/Acme/DemoBundle/Form/Type/ProductType.php
174174
namespace Acme\DemoBundle\Form\Type;

cookbook/session/sessions_directory.rst

+38-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
.. index::
22
single: Sessions, sessions directory
33

4-
Configuring the Directory where Sessions Files are Saved
4+
Configuring the Directory Where Sessions Files are Saved
55
========================================================
66

7-
By default, Symfony stores the session data in the cache directory. This
8-
means that when you clear the cache, any current sessions will also be
9-
deleted.
7+
By default, Symfony stores the session data in files in the cache
8+
directory ``%kernel.cache_dir%/sessions``. This means that when you clear
9+
the cache, any current sessions will also be deleted.
10+
11+
.. note::
12+
13+
If the ``session`` configuration key is set to ``~``, Symfony will use the
14+
global PHP ini values for ``session.save_handler`` and associated
15+
``session.save_path`` from ``php.ini``.
16+
17+
.. note::
18+
19+
While the Symfony Full Stack Framework defaults to using the
20+
``session.handler.native_file``, the Symfony Standard Edition is
21+
configured to use PHP's global session settings by default and therefor
22+
sessions will be stored according to the ``session.save_path`` location
23+
and will not be deleted when clearing the cache.
1024

1125
Using a different directory to save session data is one method to ensure
1226
that your current sessions aren't lost when you clear Symfony's cache.
@@ -30,18 +44,34 @@ session directory to ``app/sessions``:
3044
# app/config/config.yml
3145
framework:
3246
session:
47+
handler_id: session.handler.native_file
3348
save_path: "%kernel.root_dir%/sessions"
3449
3550
.. code-block:: xml
3651
3752
<!-- app/config/config.xml -->
38-
<framework:config>
39-
<framework:session save-path="%kernel.root_dir%/sessions" />
40-
</framework:config>
53+
<?xml version="1.0" encoding="UTF-8" ?>
54+
<container xmlns="http://symfony.com/schema/dic/services"
55+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
56+
xmlns:framework="http://symfony.com/schema/dic/symfony"
57+
xsi:schemaLocation="http://symfony.com/schema/dic/services
58+
http://symfony.com/schema/dic/services/services-1.0.xsd
59+
http://symfony.com/schema/dic/symfony
60+
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"
61+
>
62+
<framework:config>
63+
<framework:session handler-id="session.handler.native_file" />
64+
<framework:session save-path="%kernel.root_dir%/sessions" />
65+
</framework:config>
66+
</container>
4167
4268
.. code-block:: php
4369
4470
// app/config/config.php
4571
$container->loadFromExtension('framework', array(
46-
'session' => array('save-path' => "%kernel.root_dir%/sessions"),
72+
'session' => array(
73+
'handler-id' => 'session.handler.native_file',
74+
'save-path' => '%kernel.root_dir%/sessions',
75+
),
4776
));
77+

reference/constraints/UniqueEntity.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ Consider this example:
217217
218218
<class name="Acme\AdministrationBundle\Entity\Service">
219219
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
220-
<option name="field">
220+
<option name="fields">
221221
<value>host</value>
222222
<value>port</value>
223223
</option>

reference/forms/types/options/label_attr.rst.inc

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
label_attr
2-
~~~~~
2+
~~~~~~~~~~
33

44
**type**: ``array`` **default**: ``array()``
55

6-
Sets the html attributes for the ``<label>`` element, which will be used when
6+
Sets the html attributes for the ``<label>`` element, which will be used when
77
rendering the label for the field. It's an associative array with HTML attribute
88
as a key. This attributes can also be directly set inside the template:
99

@@ -18,5 +18,5 @@ as a key. This attributes can also be directly set inside the template:
1818
echo $view['form']->label(
1919
$form['name'],
2020
'Your name',
21-
array('class', 'CUSTOM_LABEL_CLASS')
21+
array('label_attr' => array('class' => 'CUSTOM_LABEL_CLASS'))
2222
);

reference/forms/types/password.rst

+4-2
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ always_empty
3737

3838
If set to true, the field will *always* render blank, even if the corresponding
3939
field has a value. When set to false, the password field will be rendered
40-
with the ``value`` attribute set to its true value.
40+
with the ``value`` attribute set to its true value only upon submission.
4141

4242
Put simply, if for some reason you want to render your password field
43-
*with* the password value already entered into the box, set this to false.
43+
*with* the password value already entered into the box, set this to false
44+
and submit the form.
45+
4446

4547
Inherited Options
4648
-----------------

0 commit comments

Comments
 (0)