Skip to content

Commit 249d1bf

Browse files
committed
Merge branch '2.0' into 2.1
Conflicts: book/doctrine.rst book/propel.rst book/security.rst cookbook/form/use_virtuals_forms.rst
2 parents da352a9 + 347688a commit 249d1bf

File tree

12 files changed

+62
-34
lines changed

12 files changed

+62
-34
lines changed

book/controller.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ a controller object. Controllers are also called *actions*.
102102
{
103103
public function indexAction($name)
104104
{
105-
return new Response('<html><body>Hello '.$name.'!</body></html>');
105+
return new Response('<html><body>Hello '.$name.'!</body></html>');
106106
}
107107
}
108108
@@ -684,7 +684,7 @@ the ``notice`` message:
684684
</div>
685685
{% endfor %}
686686

687-
.. code-block:: php
687+
.. code-block:: html+php
688688

689689
<?php foreach ($view['session']->getFlash('notice') as $message): ?>
690690
<div class="flash-notice">

book/http_cache.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ First, to use ESI, be sure to enable it in your application configuration:
854854
855855
// app/config/config.php
856856
$container->loadFromExtension('framework', array(
857-
...,
857+
// ...
858858
'esi' => array('enabled' => true),
859859
));
860860
@@ -887,7 +887,7 @@ matter), Symfony2 uses the standard ``render`` helper to configure ESI tags:
887887
888888
{% render url('latest_news', { 'max': 5 }), {'standalone': true} %}
889889
890-
.. code-block:: php
890+
.. code-block:: html+php
891891

892892
<?php echo $view['actions']->render(
893893
$view['router']->generate('latest_news', array('max' => 5), true),

book/page_creation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ controller, and ``index.html.twig`` the template:
344344
Hello {{ name }}!
345345
{% endblock %}
346346
347-
.. code-block:: php
347+
.. code-block:: html+php
348348

349349
<!-- src/Acme/HelloBundle/Resources/views/Hello/index.html.php -->
350350
<?php $view->extend('::base.html.php') ?>
@@ -385,7 +385,7 @@ and in the ``app`` directory:
385385
</body>
386386
</html>
387387

388-
.. code-block:: php
388+
.. code-block:: html+php
389389

390390
<!-- app/Resources/views/base.html.php -->
391391
<!DOCTYPE html>

book/routing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ a template helper function:
11911191
Read this blog post.
11921192
</a>
11931193

1194-
.. code-block:: php
1194+
.. code-block:: html+php
11951195

11961196
<a href="<?php echo $view['router']->generate('blog_show', array('slug' => 'my-blog-post')) ?>">
11971197
Read this blog post.
@@ -1207,7 +1207,7 @@ Absolute URLs can also be generated.
12071207
Read this blog post.
12081208
</a>
12091209

1210-
.. code-block:: php
1210+
.. code-block:: html+php
12111211

12121212
<a href="<?php echo $view['router']->generate('blog_show', array('slug' => 'my-blog-post'), true) ?>">
12131213
Read this blog post.

book/security.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ Finally, create the corresponding template:
493493

494494
.. code-block:: html+php
495495

496-
<?php // src/Acme/SecurityBundle/Resources/views/Security/login.html.php ?>
496+
<!-- src/Acme/SecurityBundle/Resources/views/Security/login.html.php -->
497497
<?php if ($error): ?>
498498
<div><?php echo $error->getMessage() ?></div>
499499
<?php endif; ?>
@@ -732,7 +732,7 @@ You can define as many URL patterns as you need - each is a regular expression.
732732
733733
// app/config/security.php
734734
$container->loadFromExtension('security', array(
735-
...,
735+
// ...
736736
'access_control' => array(
737737
array('path' => '^/admin/users', 'role' => 'ROLE_SUPER_ADMIN'),
738738
array('path' => '^/admin', 'role' => 'ROLE_ADMIN'),
@@ -1084,7 +1084,7 @@ In fact, you've seen this already in the example in this chapter.
10841084
10851085
// app/config/security.php
10861086
$container->loadFromExtension('security', array(
1087-
...,
1087+
// ...
10881088
'providers' => array(
10891089
'default_provider' => array(
10901090
'memory' => array(
@@ -1327,7 +1327,7 @@ configure the encoder for that user:
13271327
13281328
// app/config/security.php
13291329
$container->loadFromExtension('security', array(
1330-
...,
1330+
// ...
13311331
'encoders' => array(
13321332
'Acme\UserBundle\Entity\User' => 'sha512',
13331333
),
@@ -1554,10 +1554,10 @@ the first provider is always used:
15541554
$container->loadFromExtension('security', array(
15551555
'firewalls' => array(
15561556
'secured_area' => array(
1557-
...,
1557+
// ...
15581558
'provider' => 'user_db',
15591559
'http_basic' => array(
1560-
...,
1560+
// ...
15611561
'provider' => 'in_memory',
15621562
),
15631563
'form_login' => array(),
@@ -1669,7 +1669,7 @@ the firewall can handle this automatically for you when you activate the
16691669
'firewalls' => array(
16701670
'secured_area' => array(
16711671
// ...
1672-
'logout' => array('path' => '/logout', 'target' => '/'),
1672+
'logout' => array('path' => 'logout', 'target' => '/'),
16731673
),
16741674
),
16751675
// ...
@@ -1828,7 +1828,7 @@ done by activating the ``switch_user`` firewall listener:
18281828
$container->loadFromExtension('security', array(
18291829
'firewalls' => array(
18301830
'main'=> array(
1831-
...,
1831+
// ...
18321832
'switch_user' => true
18331833
),
18341834
),

book/templating.rst

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,20 +1251,24 @@ this classic example:
12511251

12521252
.. configuration-block::
12531253

1254-
.. code-block:: jinja
1254+
.. code-block:: html+jinja
12551255

12561256
Hello {{ name }}
12571257

12581258
.. code-block:: html+php
12591259

12601260
Hello <?php echo $name ?>
12611261

1262-
Imagine that the user enters the following code as his/her name::
1262+
Imagine that the user enters the following code as his/her name:
1263+
1264+
.. code-block:: text
12631265
12641266
<script>alert('hello!')</script>
12651267
12661268
Without any output escaping, the resulting template will cause a JavaScript
1267-
alert box to pop up::
1269+
alert box to pop up:
1270+
1271+
.. code-block:: html
12681272

12691273
Hello <script>alert('hello!')</script>
12701274

@@ -1274,7 +1278,9 @@ inside the secure area of an unknowing, legitimate user.
12741278

12751279
The answer to the problem is output escaping. With output escaping on, the
12761280
same template will render harmlessly, and literally print the ``script``
1277-
tag to the screen::
1281+
tag to the screen:
1282+
1283+
.. code-block:: html
12781284

12791285
Hello &lt;script&gt;alert(&#39;helloe&#39;)&lt;/script&gt;
12801286

@@ -1306,7 +1312,9 @@ Output Escaping in PHP
13061312

13071313
Output escaping is not automatic when using PHP templates. This means that
13081314
unless you explicitly choose to escape a variable, you're not protected. To
1309-
use output escaping, use the special ``escape()`` view method::
1315+
use output escaping, use the special ``escape()`` view method:
1316+
1317+
.. code-block:: html+php
13101318

13111319
Hello <?php echo $view->escape($name) ?>
13121320

@@ -1315,7 +1323,7 @@ within an HTML context (and thus the variable is escaped to be safe for HTML).
13151323
The second argument lets you change the context. For example, to output something
13161324
in a JavaScript string, use the ``js`` context:
13171325

1318-
.. code-block:: js
1326+
.. code-block:: html+php
13191327

13201328
var myMsg = 'Hello <?php echo $view->escape($name, 'js') ?>';
13211329

book/testing.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ for its ``DemoController`` (`DemoControllerTest`_) that reads as follows::
158158
kernel of your application. In most cases, this happens automatically.
159159
However, if your kernel is in a non-standard directory, you'll need
160160
to modify your ``phpunit.xml.dist`` file to set the ``KERNEL_DIR`` environment
161-
variable to the directory of your kernel::
161+
variable to the directory of your kernel:
162+
163+
.. code-block:: xml
162164
163165
<phpunit>
164166
<!-- ... -->

components/event_dispatcher/introduction.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,10 @@ indexed by event names and whose values are either the method name to call or
389389
an array composed of the method name to call and a priority. The example
390390
above shows how to register several listener methods for the same event in
391391
subscriber and also shows how to pass the priority of each listener method.
392+
The higher the priority, the earlier the method is called. In the above
393+
example, when the ``kernel.response`` event is triggered, the methods
394+
``onKernelResponsePre``, ``onKernelResponseMid``, and ``onKernelResponsePost``
395+
are called in that order.
392396

393397
.. index::
394398
single: Event Dispatcher; Stopping event flow

contributing/documentation/overview.rst

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,23 @@ then clone your fork:
2626
$ git clone git://github.com/YOURUSERNAME/symfony-docs.git
2727
2828
Consistent with Symfony's source code, the documentation repository is split into
29-
three branches: ``2.0`` for the current Symfony 2.0.x release, ``2.1`` for the
30-
current Symfony 2.1.x release and ``master`` as the development branch for
31-
upcoming releases.
29+
multiple branches: ``2.0``, ``2.1``, ``2.2`` corresponding to the different
30+
versions of Symfony itself. The ``master`` branch holds the documentation
31+
for the development branch of the code.
3232

33-
Unless you're documenting a feature that's new to Symfony 2.1, your changes
34-
should always be based on the 2.0 branch instead of the master branch. To do
35-
this checkout the 2.0 branch before the next step:
33+
Unless you're documenting a feature that was introduced *after* Symfony 2.0
34+
(e.g. in Symfony 2.1), your changes should always be based on the 2.0 branch.
35+
To do this checkout the 2.0 branch before the next step:
3636

3737
.. code-block:: bash
3838
3939
$ git checkout 2.0
4040
41+
.. tip::
42+
43+
Your base branch (e.g. 2.0) will become the "Applies to" in the :ref:`doc-contributing-pr-format`
44+
that you'll use later.
45+
4146
Next, create a dedicated branch for your changes (for organization):
4247

4348
.. code-block:: bash
@@ -74,6 +79,8 @@ GitHub covers the topic of `pull requests`_ in detail.
7479
The Symfony2 documentation is licensed under a Creative Commons
7580
Attribution-Share Alike 3.0 Unported :doc:`License <license>`.
7681

82+
.. _doc-contributing-pr-format:
83+
7784
Pull Request Format
7885
~~~~~~~~~~~~~~~~~~~
7986

@@ -149,7 +156,7 @@ look and feel familiar, you should follow these rules:
149156
* The code follows the :doc:`Symfony Coding Standards</contributing/code/standards>`
150157
as well as the `Twig Coding Standards`_;
151158
* Each line should break approximately after the first word that crosses the
152-
72nd character (so most lines end up being 72-78 lines);
159+
72nd character (so most lines end up being 72-78 characters);
153160
* To avoid horizontal scrolling on code blocks, we prefer to break a line
154161
correctly if it crosses the 85th character;
155162
* When you fold one or more lines of code, place ``...`` in a comment at the point
@@ -197,7 +204,7 @@ Reporting an Issue
197204
------------------
198205

199206
The most easy contribution you can make is reporting issues: a typo, a grammar
200-
mistake, a bug in code example, a missing explanation, and so on.
207+
mistake, a bug in a code example, a missing explanation, and so on.
201208

202209
Steps:
203210

cookbook/form/use_virtuals_forms.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ Start by creating a very simple ``CompanyType`` and ``CustomerType``::
4949

5050
// src/Acme/HelloBundle/Form/Type/CompanyType.php
5151
namespace Acme\HelloBundle\Form\Type;
52+
53+
use Symfony\Component\Form\AbstractType;
54+
use Symfony\Component\Form\FormBuilder;
5255

5356
use Symfony\Component\Form\AbstractType;
5457
use Symfony\Component\Form\FormBuilderInterface;
@@ -69,6 +72,7 @@ Start by creating a very simple ``CompanyType`` and ``CustomerType``::
6972
namespace Acme\HelloBundle\Form\Type;
7073
7174
use Symfony\Component\Form\FormBuilderInterface;
75+
use Symfony\Component\Form\AbstractType;
7276
7377
class CustomerType extends AbstractType
7478
{

reference/constraints/Min.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ the following:
7979
$metadata->addPropertyConstraint('age', new Assert\Min(array(
8080
'limit' => '18',
8181
'message' => 'You must be 18 or older to enter.',
82-
));
82+
)));
8383
}
8484
}
8585

reference/forms/types/money.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ the currency symbol that should be shown by the text box. Depending on
4545
the currency - the currency symbol may be shown before or after the input
4646
text field.
4747

48-
This can also be set to false to hide the currency symbol.
48+
This can be any `3 letter ISO 4217 code`_. You can also set this to false to
49+
hide the currency symbol.
4950

5051
divisor
5152
~~~~~~~
@@ -94,4 +95,6 @@ These options inherit from the :doc:`field</reference/forms/types/field>` type:
9495

9596
.. include:: /reference/forms/types/options/invalid_message.rst.inc
9697

97-
.. include:: /reference/forms/types/options/invalid_message_parameters.rst.inc
98+
.. include:: /reference/forms/types/options/invalid_message_parameters.rst.inc
99+
100+
.. _`3 letter ISO 4217 code`: http://en.wikipedia.org/wiki/ISO_4217

0 commit comments

Comments
 (0)