Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9d4a138

Browse files
committedDec 8, 2013
Merge branch 'master' into eom-2-2
Conflicts: book/security.rst components/property_access/introduction.rst components/stopwatch.rst cookbook/templating/namespaced_paths.rst reference/twig_reference.rst
2 parents 10fe8a4 + 821a1b4 commit 9d4a138

File tree

267 files changed

+4128
-2038
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

267 files changed

+4128
-2038
lines changed
 

‎book/controller.rst

100755100644
Lines changed: 17 additions & 14 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
}
@@ -501,9 +501,9 @@ value to each variable.
501501
directly by duplicating the current request. When this
502502
:ref:`sub request <http-kernel-sub-requests>` is executed via the ``http_kernel``
503503
service the ``HttpKernel`` returns a ``Response`` object::
504-
504+
505505
use Symfony\Component\HttpKernel\HttpKernelInterface;
506-
506+
507507
$path = array(
508508
'_controller' => 'AcmeHelloBundle:Hello:fancy',
509509
'name' => $name,
@@ -750,12 +750,15 @@ headers and content that's sent back to the client::
750750
use Symfony\Component\HttpFoundation\Response;
751751

752752
// create a simple Response with a 200 status code (the default)
753-
$response = new Response('Hello '.$name, 200);
753+
$response = new Response('Hello '.$name, Response::HTTP_OK);
754754

755755
// create a JSON-response with a 200 status code
756756
$response = new Response(json_encode(array('name' => $name)));
757757
$response->headers->set('Content-Type', 'application/json');
758758

759+
.. versionadded:: 2.4
760+
Support for HTTP status code constants was added in Symfony 2.4.
761+
759762
.. tip::
760763

761764
The ``headers`` property is a

‎book/doctrine.rst

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ in a way that makes sense for your needs. The fact that the data needs to
10871087
be persisted to a database is always secondary.
10881088

10891089
Now, look at the metadata above the ``$category`` property on the ``Product``
1090-
class. The information here tells doctrine that the related class is ``Category``
1090+
class. The information here tells Doctrine that the related class is ``Category``
10911091
and that it should store the ``id`` of the category record on a ``category_id``
10921092
field that lives on the ``product`` table. In other words, the related ``Category``
10931093
object will be stored on the ``$category`` property, but behind the scenes,
@@ -1285,7 +1285,7 @@ More Information on Associations
12851285

12861286
This section has been an introduction to one common type of entity relationship,
12871287
the one-to-many relationship. For more advanced details and examples of how
1288-
to use other types of relations (e.g. ``one-to-one``, ``many-to-many``), see
1288+
to use other types of relations (e.g. one-to-one, many-to-many), see
12891289
Doctrine's `Association Mapping Documentation`_.
12901290

12911291
.. note::
@@ -1441,12 +1441,19 @@ using. The following types are supported in Doctrine:
14411441
* ``date``
14421442
* ``time``
14431443
* ``datetime``
1444+
* ``datetimetz``
14441445

14451446
* **Other Types**
14461447

14471448
* ``boolean``
14481449
* ``object`` (serialized and stored in a ``CLOB`` field)
14491450
* ``array`` (serialized and stored in a ``CLOB`` field)
1451+
* ``blob`` (mapped to a resource stream)
1452+
* ``simple_array`` (serialized using :phpfunction:`implode()` and :phpfunction:`explode()`,
1453+
with a comma as delimiter, and stored in a ``CLOB`` field)
1454+
* ``json_array`` (serialized using :phpfunction:`json_encode()` and :phpfunction:`json_decode()`,
1455+
and stored in a ``CLOB`` field)
1456+
* ``guid``
14501457

14511458
For more information, see Doctrine's `Mapping Types documentation`_.
14521459

@@ -1483,7 +1490,7 @@ and ``nullable``. Take a few examples:
14831490
fields:
14841491
# A string field length 255 that cannot be null
14851492
# (reflecting the default values for the "length" and *nullable* options)
1486-
# type attribute is necessary in yaml definitions
1493+
# type attribute is necessary in YAML definitions
14871494
name:
14881495
type: string
14891496
@@ -1500,7 +1507,7 @@ and ``nullable``. Take a few examples:
15001507
<!--
15011508
A string field length 255 that cannot be null
15021509
(reflecting the default values for the "length" and *nullable* options)
1503-
type attribute is necessary in xml definitions
1510+
type attribute is necessary in XML definitions
15041511
-->
15051512
<field name="name" type="string" />
15061513
<field name="email"
@@ -1562,7 +1569,7 @@ Some notable or interesting tasks include:
15621569
.. note::
15631570

15641571
To be able to load data fixtures to your database, you will need to have
1565-
the ``DoctrineFixturesBundle`` bundle installed. To learn how to do it,
1572+
the DoctrineFixturesBundle bundle installed. To learn how to do it,
15661573
read the ":doc:`/bundles/DoctrineFixturesBundle/index`" entry of the
15671574
documentation.
15681575

0 commit comments

Comments
 (0)