Skip to content

Commit 3f6e79a

Browse files
committed
Merge branch '3.0'
2 parents 6b1abf7 + a59f2d5 commit 3f6e79a

14 files changed

+182
-63
lines changed

book/controller.rst

+25-25
Original file line numberDiff line numberDiff line change
@@ -321,42 +321,42 @@ Keep the following guidelines in mind while you develop.
321321

322322
#. **The order of the controller arguments does not matter**
323323

324-
Symfony matches the parameter **names** from the route to the variable
325-
**names** of the controller. The arguments of the controller could be
326-
totally reordered and still work perfectly::
324+
Symfony matches the parameter **names** from the route to the variable
325+
**names** of the controller. The arguments of the controller could be
326+
totally reordered and still work perfectly::
327327

328-
public function indexAction($lastName, $firstName)
329-
{
330-
// ...
331-
}
328+
public function indexAction($lastName, $firstName)
329+
{
330+
// ...
331+
}
332332

333333
#. **Each required controller argument must match up with a routing parameter**
334334

335-
The following would throw a ``RuntimeException`` because there is no
336-
``foo`` parameter defined in the route::
335+
The following would throw a ``RuntimeException`` because there is no
336+
``foo`` parameter defined in the route::
337337

338-
public function indexAction($firstName, $lastName, $foo)
339-
{
340-
// ...
341-
}
338+
public function indexAction($firstName, $lastName, $foo)
339+
{
340+
// ...
341+
}
342342

343-
Making the argument optional, however, is perfectly ok. The following
344-
example would not throw an exception::
343+
Making the argument optional, however, is perfectly ok. The following
344+
example would not throw an exception::
345345

346-
public function indexAction($firstName, $lastName, $foo = 'bar')
347-
{
348-
// ...
349-
}
346+
public function indexAction($firstName, $lastName, $foo = 'bar')
347+
{
348+
// ...
349+
}
350350

351351
#. **Not all routing parameters need to be arguments on your controller**
352352

353-
If, for example, the ``lastName`` weren't important for your controller,
354-
you could omit it entirely::
353+
If, for example, the ``lastName`` weren't important for your controller,
354+
you could omit it entirely::
355355

356-
public function indexAction($firstName)
357-
{
358-
// ...
359-
}
356+
public function indexAction($firstName)
357+
{
358+
// ...
359+
}
360360

361361
.. tip::
362362

book/installation.rst

+12-10
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,9 @@ If there are any issues, correct them now before moving on.
237237
its user to be the same as your CLI user (e.g. for Apache, update the ``User``
238238
and ``Group`` values).
239239

240-
**2. Using ACL on a system that supports chmod +a**
240+
**2. Using ACL on a system that supports chmod +a (MacOS X)**
241241

242-
Many systems allow you to use the ``chmod +a`` command. Try this first,
243-
and if you get an error - try the next method. This uses a command to
242+
MacOS X allows you to use the ``chmod +a`` command. This uses a command to
244243
try to determine your web server user and set it as ``HTTPDUSER``:
245244

246245
.. code-block:: bash
@@ -251,14 +250,12 @@ If there are any issues, correct them now before moving on.
251250
$ sudo chmod -R +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" var
252251
$ sudo chmod -R +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" var
253252
253+
**3. Using ACL on a system that supports setfacl (most Linux/BSD)**
254254

255-
**3. Using ACL on a system that does not support chmod +a**
256-
257-
Some systems don't support ``chmod +a``, but do support another utility
258-
called ``setfacl``. You may need to `enable ACL support`_ on your partition
259-
and install setfacl before using it (as is the case with Ubuntu). This
260-
uses a command to try to determine your web server user and set it as
261-
``HTTPDUSER``:
255+
Most Linux and BSD distributions don't support ``chmod +a``, but do support
256+
another utility called ``setfacl``. You may need to `enable ACL support`_
257+
on your partition and install setfacl before using it. This uses a command
258+
to try to determine your web server user and set it as ``HTTPDUSER``:
262259

263260
.. code-block:: bash
264261
@@ -268,6 +265,11 @@ If there are any issues, correct them now before moving on.
268265
269266
If this doesn't work, try adding ``-n`` option.
270267

268+
.. note::
269+
270+
setfacl isn't available on NFS mount points. However, setting cache
271+
and logs over NFS is strongly not recommended for performance.
272+
271273
**4. Without using ACL**
272274

273275
If none of the previous methods work for you, change the umask so that the

book/routing.rst

+7
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,13 @@ Path Parameters
805805
``/es`` *won't match this route*
806806
======= ========================
807807

808+
.. tip::
809+
810+
The route requirements can also include container parameters, as explained
811+
in :doc:`this article </cookbook/routing/service_container_parameters>`.
812+
This comes in handy when the regular expression is very complex and used
813+
repeatedly in your application.
814+
808815
.. index::
809816
single: Routing; Method requirement
810817

changelog.rst

+51
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,57 @@ documentation.
1313
Do you also want to participate in the Symfony Documentation? Take a look
1414
at the ":doc:`/contributing/documentation/overview`" article.
1515

16+
April, 2016
17+
-----------
18+
19+
New Documentation
20+
~~~~~~~~~~~~~~~~~
21+
22+
* `#6470 <https://github.com./symfony/symfony-docs/pull/6470>`_ Documented the config options of TwigBundle (javiereguiluz)
23+
* `#6427 <https://github.com./symfony/symfony-docs/pull/6427>`_ [Testing] Explain how to add or remove data in a collection of forms (alexislefebvre)
24+
* `#6465 <https://github.com./symfony/symfony-docs/pull/6465>`_ Added ldap to the list of user providers (AAstakhov)
25+
* `#6450 <https://github.com./symfony/symfony-docs/pull/6450>`_ [Form] added prototype_data option in CollectionType (kgilden, HeahDude)
26+
* `#6394 <https://github.com./symfony/symfony-docs/pull/6394>`_ Updated Heroku instructions (magnusnordlander)
27+
28+
Fixed Documentation
29+
~~~~~~~~~~~~~~~~~~~
30+
31+
* `#6503 <https://github.com./symfony/symfony-docs/pull/6503>`_ Fix typo in from flat PHP to Symfony (gregfriedrice, WouterJ)
32+
* `#6483 <https://github.com./symfony/symfony-docs/pull/6483>`_ Fix typo: signifcantly => significantly (ifdattic)
33+
* `#6482 <https://github.com./symfony/symfony-docs/pull/6482>`_ fixed wrong secret string in array examples (OskarStark)
34+
* `#6460 <https://github.com./symfony/symfony-docs/pull/6460>`_ Update authorization.rst (mantulo)
35+
* `#6451 <https://github.com./symfony/symfony-docs/pull/6451>`_ fix status code in snippet (Barno)
36+
* `#6448 <https://github.com./symfony/symfony-docs/pull/6448>`_ [Form] fixed CollectionType needless option (HeahDude)
37+
* `#6439 <https://github.com./symfony/symfony-docs/pull/6439>`_ Fix form/validation directory path (nemo-)
38+
39+
Minor Documentation Changes
40+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
41+
42+
* `#6522 <https://github.com./symfony/symfony-docs/pull/6522>`_ On line 360 the ``404 Not Found`` header not working (mbrig-co)
43+
* `#6521 <https://github.com./symfony/symfony-docs/pull/6521>`_ The ``$link`` argument must be passed as a reference (mbrig-co)
44+
* `#6523 <https://github.com./symfony/symfony-docs/pull/6523>`_ Fix snippet (ismailbaskin)
45+
* `#6472 <https://github.com./symfony/symfony-docs/pull/6472>`_ Avoid confusion (gerryvdm)
46+
* `#6300 <https://github.com./symfony/symfony-docs/pull/6300>`_ Document constraint validator alias optional (Triiistan)
47+
* `#6513 <https://github.com./symfony/symfony-docs/pull/6513>`_ remove documentation of not supported "verbose" option value (TobiasXy)
48+
* `#6507 <https://github.com./symfony/symfony-docs/pull/6507>`_ fix typo (tyx)
49+
* `#6509 <https://github.com./symfony/symfony-docs/pull/6509>`_ Update http_kernel_httpkernel_class.rst (AchillesKal)
50+
* `#6510 <https://github.com./symfony/symfony-docs/pull/6510>`_ use port 587 in Amazon SES example (snoek09)
51+
* `#6464 <https://github.com./symfony/symfony-docs/pull/6464>`_ Added possible values for access_decision_manager.strategy (AAstakhov)
52+
* `#6478 <https://github.com./symfony/symfony-docs/pull/6478>`_ Replace reference to the request service (gerryvdm)
53+
* `#6479 <https://github.com./symfony/symfony-docs/pull/6479>`_ Update php.rst (carlos-granados)
54+
* `#6481 <https://github.com./symfony/symfony-docs/pull/6481>`_ Remove reference to Symfony2 in request-flow.png (Daniel Cotton)
55+
* `#6471 <https://github.com./symfony/symfony-docs/pull/6471>`_ fix broken merge (xabbuh)
56+
* `#6449 <https://github.com./symfony/symfony-docs/pull/6449>`_ [Form] fixed ChoiceType example in CollectionType (HeahDude)
57+
* `#6445 <https://github.com./symfony/symfony-docs/pull/6445>`_ updated the core team (fabpot)
58+
* `#6423 <https://github.com./symfony/symfony-docs/pull/6423>`_ Added a caution note about REMOTE_USER and user impersonation (javiereguiluz)
59+
* `#6452 <https://github.com./symfony/symfony-docs/pull/6452>`_ Use different placeholders in mailer config (sblaut)
60+
* `#6457 <https://github.com./symfony/symfony-docs/pull/6457>`_ Fixed an array notation in comment (serializer.rst) (iltar)
61+
* `#6456 <https://github.com./symfony/symfony-docs/pull/6456>`_ Fixed array [] notation and trailing spaces (iltar)
62+
* `#6420 <https://github.com./symfony/symfony-docs/pull/6420>`_ Added tip for optional second parameter for form submissions. (Michael Phillips)
63+
* `#6418 <https://github.com./symfony/symfony-docs/pull/6418>`_ fix spelling of the flashBag() method (xabbuh)
64+
* `#6432 <https://github.com./symfony/symfony-docs/pull/6432>`_ fixed yaml config error (RickieL)
65+
66+
1667
March, 2016
1768
-----------
1869

components/dependency_injection/definitions.rst

+54-14
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
Working with Container Service Definitions
55
==========================================
66

7+
Service definitions are the instructions describing how the container should
8+
build a service. They are not the actual services used by your applications
9+
710
Getting and Setting Service Definitions
811
---------------------------------------
912

@@ -32,34 +35,68 @@ with these methods and make changes to it these will be reflected in the
3235
container. If, however, you are creating a new definition then you can add
3336
it to the container using::
3437

35-
$container->setDefinition($id, $definition);
38+
use Symfony\Component\DependencyInjection\Definition;
39+
40+
$definition = new Definition('Acme\Service\MyService');
41+
$container->setDefinition('acme.my_service', $definition);
42+
43+
.. tip::
44+
45+
Registering service definitions is so common that the container provides a
46+
shortcut method called ``register()``::
47+
48+
$container->register('acme.my_service', 'Acme\Service\MyService');
3649

3750
Working with a Definition
3851
-------------------------
3952

4053
Creating a New Definition
4154
~~~~~~~~~~~~~~~~~~~~~~~~~
4255

43-
If you need to create a new definition rather than manipulate one retrieved
44-
from the container then the definition class is :class:`Symfony\\Component\\DependencyInjection\\Definition`.
56+
In addition to manipulating and retrieving existing definitions, you can also
57+
define new service definitions with the :class:`Symfony\\Component\\DependencyInjection\\Definition`
58+
class.
4559

4660
Class
4761
~~~~~
4862

49-
First up is the class of a definition, this is the class of the object returned
50-
when the service is requested from the container.
63+
The first optional argument of the ``Definition`` class is the fully qualified
64+
class name of the object returned when the service is fetched from the container::
5165

52-
To find out what class is set for a definition::
66+
use Symfony\Component\DependencyInjection\Definition;
67+
68+
$definition = new Definition('Acme\Service\MyService');
69+
70+
If the class is unknown when instantiating the ``Definition`` class, use the
71+
``setClass()`` method to set it later::
5372

54-
$definition->getClass();
73+
$definition->setClass('Acme\Service\MyService');
5574

56-
and to set a different class::
75+
To find out what class is set for a definition::
5776

58-
$definition->setClass($class); // Fully qualified class name as string
77+
$class = $definition->getClass();
78+
// $class = 'Acme\Service\MyService'
5979

6080
Constructor Arguments
6181
~~~~~~~~~~~~~~~~~~~~~
6282

83+
The second optional argument of the ``Definition`` class is an array with the
84+
arguments passed to the constructor of the object returned when the service is
85+
fetched from the container::
86+
87+
use Symfony\Component\DependencyInjection\Definition;
88+
89+
$definition = new Definition(
90+
'Acme\Service\MyService',
91+
array('argument1' => 'value1', 'argument2' => 'value2')
92+
);
93+
94+
If the arguments are unknown when instantiating the ``Definition`` class or if
95+
you want to add new arguments, use the ``addArgument()`` method, which adds them
96+
at the end of the arguments array::
97+
98+
$definition->addArgument($argument);
99+
63100
To get an array of the constructor arguments for a definition you can use::
64101

65102
$definition->getArguments();
@@ -69,12 +106,16 @@ or to get a single argument by its position::
69106
$definition->getArgument($index);
70107
// e.g. $definition->getArgument(0) for the first argument
71108

72-
You can add a new argument to the end of the arguments array using::
109+
The argument can be a string, an array or a service parameter by using the
110+
``%parameter_name%`` syntax::
73111

74-
$definition->addArgument($argument);
112+
$definition->addArgument('%kernel_debug%');
75113

76-
The argument can be a string, an array, a service parameter by using ``%parameter_name%``
77-
or a service id by using::
114+
If the argument is another service, don't use the ``get()`` method to fetch it,
115+
because it won't be available when defining services. Instead, use the
116+
:class:`Symfony\\Component\\DependencyInjection\\Reference` class to get a
117+
reference to the service which will be available once the service container is
118+
fully built::
78119

79120
use Symfony\Component\DependencyInjection\Reference;
80121

@@ -139,4 +180,3 @@ the service itself gets loaded. To do so, you can use the
139180

140181
Notice that Symfony will internally call the PHP statement ``require_once``,
141182
which means that your file will be included only once per request.
142-

components/dependency_injection/introduction.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ like this::
104104
// ...
105105
}
106106

107-
Then you can register this as a service as well and pass the ``mailer`` service into it::
107+
When defining the ``newsletter_manager`` service, the ``mailer`` service does
108+
not exist yet. Use the ``Reference`` class to tell the container to inject the
109+
``mailer`` service when it initializes the newsletter manager::
108110

109111
use Symfony\Component\DependencyInjection\ContainerBuilder;
110112
use Symfony\Component\DependencyInjection\Reference;

contributing/community/releases.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,4 @@ version is published every two years and there is a year to upgrade.
187187
.. _SensioLabs: http://sensiolabs.com/
188188
.. _roadmap notification: https://symfony.com/roadmap
189189
.. _extended to September 2014: https://symfony.com/blog/extended-maintenance-for-symfony-2-4
190-
.. _timeline calculator: https://symfony.com/roadmap
190+
.. _timeline calculator: https://symfony.com/roadmap#checker

reference/forms/types/birthday.rst

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ option defaults to 120 years ago to the current year.
2424
+----------------------+-------------------------------------------------------------------------------+
2525
| Inherited options | from the :doc:`DateType </reference/forms/types/date>`: |
2626
| | |
27+
| | - `choice_translation_domain`_ |
2728
| | - `days`_ |
2829
| | - `placeholder`_ |
2930
| | - `format`_ |
@@ -63,6 +64,8 @@ Inherited Options
6364

6465
These options inherit from the :doc:`DateType </reference/forms/types/date>`:
6566

67+
.. include:: /reference/forms/types/options/datetime_choice_translation_domain.rst.inc
68+
6669
.. include:: /reference/forms/types/options/days.rst.inc
6770

6871
placeholder

reference/forms/types/date.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ day and year) or three select boxes (see the `widget`_ option).
1919
+----------------------+-----------------------------------------------------------------------------+
2020
| Rendered as | single text box or three select fields |
2121
+----------------------+-----------------------------------------------------------------------------+
22-
| Options | - `days`_ |
22+
| Options | - `choice_translation_domain`_ |
23+
| | - `days`_ |
2324
| | - `placeholder`_ |
2425
| | - `format`_ |
2526
| | - `html5`_ |
@@ -84,6 +85,8 @@ values.
8485
Field Options
8586
-------------
8687

88+
.. include:: /reference/forms/types/options/datetime_choice_translation_domain.rst.inc
89+
8790
.. include:: /reference/forms/types/options/days.rst.inc
8891

8992
placeholder

reference/forms/types/datetime.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array.
1515
+----------------------+-----------------------------------------------------------------------------+
1616
| Rendered as | single text box or three select fields |
1717
+----------------------+-----------------------------------------------------------------------------+
18-
| Options | - `date_format`_ |
18+
| Options | - `choice_translation_domain`_ |
19+
| | - `date_format`_ |
1920
| | - `date_widget`_ |
2021
| | - `days`_ |
2122
| | - `placeholder`_ |
@@ -54,6 +55,8 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array.
5455
Field Options
5556
-------------
5657

58+
.. include:: /reference/forms/types/options/datetime_choice_translation_domain.rst.inc
59+
5760
date_format
5861
~~~~~~~~~~~
5962

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
**type**: ``string``, ``boolean`` or ``null``
2+
3+
This option determines if the choice values should be translated and in which
4+
translation domain.
5+
6+
The values of the ``choice_translation_domain`` option can be ``true`` (reuse the current
7+
translation domain), ``false`` (disable translation), ``null`` (uses the parent translation
8+
domain or the default domain) or a string which represents the exact translation
9+
domain to use.
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
choice_translation_domain
22
~~~~~~~~~~~~~~~~~~~~~~~~~
33

4-
**type**: ``string``, ``boolean`` or ``null``
5-
6-
This option determines if the choice values should be translated and in which
7-
translation domain.
8-
9-
The values of the ``choice_translation_domain`` option can be ``true`` (reuse the current
10-
translation domain), ``false`` (disable translation), ``null`` (uses the parent translation
11-
domain or the default domain) or a string which represents the exact translation
12-
domain to use.
4+
.. include:: /reference/forms/types/options/_choice_translation_domain_body.rst.inc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
choice_translation_domain
2+
~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
.. include:: /reference/forms/types/options/_choice_translation_domain_body.rst.inc

0 commit comments

Comments
 (0)