Skip to content

Commit 4b97990

Browse files
committed
Merge branch '2.2' into 2.3
Conflicts: book/security.rst
2 parents e15226e + 567ba19 commit 4b97990

File tree

4 files changed

+42
-18
lines changed

4 files changed

+42
-18
lines changed

book/controller.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ example:
236236
237237
# app/config/routing.yml
238238
hello:
239-
path: /hello/{first_name}/{last_name}
239+
path: /hello/{firstName}/{lastName}
240240
defaults: { _controller: AcmeHelloBundle:Hello:index, color: green }
241241
242242
.. code-block:: xml
@@ -248,7 +248,7 @@ example:
248248
xsi:schemaLocation="http://symfony.com/schema/routing
249249
http://symfony.com/schema/routing/routing-1.0.xsd">
250250
251-
<route id="hello" path="/hello/{first_name}/{last_name}">
251+
<route id="hello" path="/hello/{firstName}/{lastName}">
252252
<default key="_controller">AcmeHelloBundle:Hello:index</default>
253253
<default key="color">green</default>
254254
</route>
@@ -257,19 +257,19 @@ example:
257257
.. code-block:: php
258258
259259
// app/config/routing.php
260-
$collection->add('hello', new Route('/hello/{first_name}/{last_name}', array(
260+
$collection->add('hello', new Route('/hello/{firstName}/{lastName}', array(
261261
'_controller' => 'AcmeHelloBundle:Hello:index',
262262
'color' => 'green',
263263
)));
264264
265265
The controller for this can take several arguments::
266266

267-
public function indexAction($first_name, $last_name, $color)
267+
public function indexAction($firstName, $lastName, $color)
268268
{
269269
// ...
270270
}
271271

272-
Notice that both placeholder variables (``{first_name}``, ``{last_name}``)
272+
Notice that both placeholder variables (``{firstName}``, ``{lastName}``)
273273
as well as the default ``color`` variable are available as arguments in the
274274
controller. When a route is matched, the placeholder variables are merged
275275
with the ``defaults`` to make one array that's available to your controller.
@@ -281,11 +281,11 @@ the following guidelines in mind while you develop.
281281

282282
Symfony is able to match the parameter names from the route to the variable
283283
names in the controller method's signature. In other words, it realizes that
284-
the ``{last_name}`` parameter matches up with the ``$last_name`` argument.
284+
the ``{lastName}`` parameter matches up with the ``$lastName`` argument.
285285
The arguments of the controller could be totally reordered and still work
286286
perfectly::
287287

288-
public function indexAction($last_name, $color, $first_name)
288+
public function indexAction($lastName, $color, $firstName)
289289
{
290290
// ...
291291
}
@@ -295,25 +295,25 @@ the following guidelines in mind while you develop.
295295
The following would throw a ``RuntimeException`` because there is no ``foo``
296296
parameter defined in the route::
297297

298-
public function indexAction($first_name, $last_name, $color, $foo)
298+
public function indexAction($firstName, $lastName, $color, $foo)
299299
{
300300
// ...
301301
}
302302

303303
Making the argument optional, however, is perfectly ok. The following
304304
example would not throw an exception::
305305

306-
public function indexAction($first_name, $last_name, $color, $foo = 'bar')
306+
public function indexAction($firstName, $lastName, $color, $foo = 'bar')
307307
{
308308
// ...
309309
}
310310

311311
* **Not all routing parameters need to be arguments on your controller**
312312

313-
If, for example, the ``last_name`` weren't important for your controller,
313+
If, for example, the ``lastName`` weren't important for your controller,
314314
you could omit it entirely::
315315

316-
public function indexAction($first_name, $color)
316+
public function indexAction($firstName, $color)
317317
{
318318
// ...
319319
}

book/security.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,14 @@ the trusted reverse proxy cache.
898898
construct. Prior to 2.3, users should create one rule per IP address to match and
899899
use the ``ip`` key instead of ``ips``.
900900

901+
.. caution::
902+
903+
As you'll read in the explanation below the example, the ``ip`` option
904+
does not restrict to a specific IP address. Instead, using the ``ip``
905+
key means that the ``access_control`` entry will only match this IP address,
906+
and users accessing it from a different IP address will continue down
907+
the ``acces_control`` list.
908+
901909
Here is an example of how you might secure all ESI routes that start with a
902910
given prefix, ``/esi``, from outside access:
903911

@@ -957,11 +965,13 @@ address):
957965

958966
.. _book-security-securing-channel:
959967

960-
Securing by Channel
961-
~~~~~~~~~~~~~~~~~~~
968+
Forcing a Channel (http, https)
969+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
962970

963971
You can also require a user to access a URL via SSL; just use the
964-
``requires_channel`` argument in any ``access_control`` entries:
972+
``requires_channel`` argument in any ``access_control`` entries. If this
973+
``access_control`` is matched and the request is using the ``http`` channel,
974+
the user will be redirected to ``https``:
965975

966976
.. configuration-block::
967977

reference/forms/types/checkbox.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ if the box is unchecked, the value will be set to false.
1313
+-------------+------------------------------------------------------------------------+
1414
| Options | - `value`_ |
1515
+-------------+------------------------------------------------------------------------+
16-
| Inherited | - `required`_ |
17-
| options | - `label`_ |
16+
| Inherited | - `data`_ |
17+
| options | - `required`_ |
18+
| | - `label`_ |
1819
| | - `read_only`_ |
1920
| | - `disabled`_ |
2021
| | - `error_bubbling`_ |
@@ -47,11 +48,17 @@ value
4748
The value that's actually used as the value for the checkbox. This does
4849
not affect the value that's set on your object.
4950

51+
.. caution::
52+
53+
To make a checkbox checked by default, use the `data`_ option.
54+
5055
Inherited options
5156
-----------------
5257

5358
These options inherit from the :doc:`form </reference/forms/types/form>` type:
5459

60+
.. include:: /reference/forms/types/options/data.rst.inc
61+
5562
.. include:: /reference/forms/types/options/required.rst.inc
5663

5764
.. include:: /reference/forms/types/options/label.rst.inc

reference/forms/types/radio.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ If you want to have a Boolean field, use :doc:`checkbox </reference/forms/types/
1717
+-------------+---------------------------------------------------------------------+
1818
| Options | - `value`_ |
1919
+-------------+---------------------------------------------------------------------+
20-
| Inherited | - `required`_ |
21-
| options | - `label`_ |
20+
| Inherited | - `data`_ |
21+
| options | - `required`_ |
22+
| | - `label`_ |
2223
| | - `read_only`_ |
2324
| | - `disabled`_ |
2425
| | - `error_bubbling`_ |
@@ -41,11 +42,17 @@ value
4142
The value that's actually used as the value for the radio button. This does
4243
not affect the value that's set on your object.
4344

45+
.. caution::
46+
47+
To make a radio button checked by default, use the `data`_ option.
48+
4449
Inherited Options
4550
-----------------
4651

4752
These options inherit from the :doc:`form </reference/forms/types/form>` type:
4853

54+
.. include:: /reference/forms/types/options/data.rst.inc
55+
4956
.. include:: /reference/forms/types/options/required.rst.inc
5057

5158
.. include:: /reference/forms/types/options/label.rst.inc

0 commit comments

Comments
 (0)