Skip to content

Commit 078bb2d

Browse files
committed
Merge branch '2.8'
2 parents f78cab7 + 59569c0 commit 078bb2d

19 files changed

+153
-49
lines changed

book/forms.rst

+17-14
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ from inside a controller::
7777
// src/AppBundle/Controller/DefaultController.php
7878
namespace AppBundle\Controller;
7979

80-
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
8180
use AppBundle\Entity\Task;
81+
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
8282
use Symfony\Component\HttpFoundation\Request;
8383

8484
class DefaultController extends Controller
@@ -546,16 +546,17 @@ This will call the static method ``determineValidationGroups()`` on the
546546
The Form object is passed as an argument to that method (see next example).
547547
You can also define whole logic inline by using a ``Closure``::
548548

549-
use Acme\AcmeBundle\Entity\Client;
549+
use AppBundle\Entity\Client;
550550
use Symfony\Component\Form\FormInterface;
551551
use Symfony\Component\OptionsResolver\OptionsResolver;
552552

553553
// ...
554554
public function configureOptions(OptionsResolver $resolver)
555555
{
556556
$resolver->setDefaults(array(
557-
'validation_groups' => function(FormInterface $form) {
557+
'validation_groups' => function (FormInterface $form) {
558558
$data = $form->getData();
559+
559560
if (Client::TYPE_PERSON == $data->getType()) {
560561
return array('person');
561562
}
@@ -569,16 +570,17 @@ Using the ``validation_groups`` option overrides the default validation
569570
group which is being used. If you want to validate the default constraints
570571
of the entity as well you have to adjust the option as follows::
571572

572-
use Acme\AcmeBundle\Entity\Client;
573+
use AppBundle\Entity\Client;
573574
use Symfony\Component\Form\FormInterface;
574575
use Symfony\Component\OptionsResolver\OptionsResolver;
575576

576577
// ...
577578
public function configureOptions(OptionsResolver $resolver)
578579
{
579580
$resolver->setDefaults(array(
580-
'validation_groups' => function(FormInterface $form) {
581+
'validation_groups' => function (FormInterface $form) {
581582
$data = $form->getData();
583+
582584
if (Client::TYPE_PERSON == $data->getType()) {
583585
return array('Default', 'person');
584586
}
@@ -1052,7 +1054,8 @@ that will house the logic for building the task form::
10521054
$builder
10531055
->add('task')
10541056
->add('dueDate', null, array('widget' => 'single_text'))
1055-
->add('save', 'submit');
1057+
->add('save', 'submit')
1058+
;
10561059
}
10571060

10581061
public function getName()
@@ -1127,7 +1130,8 @@ the choice is ultimately up to you.
11271130
$builder
11281131
->add('task')
11291132
->add('dueDate', null, array('mapped' => false))
1130-
->add('save', 'submit');
1133+
->add('save', 'submit')
1134+
;
11311135
}
11321136

11331137
Additionally, if there are any fields on the form that aren't included in
@@ -1159,7 +1163,7 @@ easy to use in your application.
11591163
11601164
# src/AppBundle/Resources/config/services.yml
11611165
services:
1162-
acme_demo.form.type.task:
1166+
app.form.type.task:
11631167
class: AppBundle\Form\Type\TaskType
11641168
tags:
11651169
- { name: form.type, alias: task }
@@ -1173,10 +1177,7 @@ easy to use in your application.
11731177
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
11741178
11751179
<services>
1176-
<service
1177-
id="acme_demo.form.type.task"
1178-
class="AppBundle\Form\Type\TaskType">
1179-
1180+
<service id="app.form.type.task" class="AppBundle\Form\Type\TaskType">
11801181
<tag name="form.type" alias="task" />
11811182
</service>
11821183
</services>
@@ -1187,7 +1188,7 @@ easy to use in your application.
11871188
// src/AppBundle/Resources/config/services.php
11881189
$container
11891190
->register(
1190-
'acme_demo.form.type.task',
1191+
'app.form.type.task',
11911192
'AppBundle\Form\Type\TaskType'
11921193
)
11931194
->addTag('form.type', array(
@@ -1480,6 +1481,7 @@ renders the form:
14801481
{# app/Resources/views/default/new.html.twig #}
14811482
{% form_theme form 'form/fields.html.twig' %}
14821483

1484+
{# or if you want to use multiple themes #}
14831485
{% form_theme form 'form/fields.html.twig' 'form/fields2.html.twig' %}
14841486

14851487
{# ... render the form #}
@@ -1489,6 +1491,7 @@ renders the form:
14891491
<!-- app/Resources/views/default/new.html.php -->
14901492
<?php $view['form']->setTheme($form, array('form')) ?>
14911493

1494+
<!-- or if you want to use multiple themes -->
14921495
<?php $view['form']->setTheme($form, array('form', 'form2')) ?>
14931496

14941497
<!-- ... render the form -->
@@ -1735,7 +1738,7 @@ file:
17351738
'Form',
17361739
),
17371740
),
1738-
)
1741+
),
17391742
// ...
17401743
));
17411744

book/templating.rst

+13-13
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Throughout this chapter, template examples will be shown in both Twig and PHP.
135135
web designers everywhere.
136136

137137
Twig can also do things that PHP can't, such as whitespace control,
138-
sandboxing, automatic HTML escaping, manual contextual output escaping,
138+
sandboxing, automatic HTML escaping, manual contextual output escaping,
139139
and the inclusion of custom functions and filters that only affect templates.
140140
Twig contains little features that make writing templates easier and more concise.
141141
Take the following example, which combines a loop with a logical ``if``
@@ -206,8 +206,8 @@ First, build a base layout file:
206206
<div id="sidebar">
207207
{% block sidebar %}
208208
<ul>
209-
<li><a href="/">Home</a></li>
210-
<li><a href="/blog">Blog</a></li>
209+
<li><a href="/">Home</a></li>
210+
<li><a href="/blog">Blog</a></li>
211211
</ul>
212212
{% endblock %}
213213
</div>
@@ -654,7 +654,7 @@ string syntax for controllers (i.e. **bundle**:**controller**:**action**):
654654
{# ... #}
655655
<div id="sidebar">
656656
{{ render(controller(
657-
'AcmeArticleBundle:Article:recentArticles',
657+
'AppBundle:Article:recentArticles',
658658
{ 'max': 3 }
659659
)) }}
660660
</div>
@@ -667,7 +667,7 @@ string syntax for controllers (i.e. **bundle**:**controller**:**action**):
667667
<div id="sidebar">
668668
<?php echo $view['actions']->render(
669669
new \Symfony\Component\HttpKernel\Controller\ControllerReference(
670-
'AcmeArticleBundle:Article:recentArticles',
670+
'AppBundle:Article:recentArticles',
671671
array('max' => 3)
672672
)
673673
) ?>
@@ -784,7 +784,7 @@ in your application configuration:
784784
// app/config/config.php
785785
$container->loadFromExtension('framework', array(
786786
// ...
787-
'templating' => array(
787+
'templating' => array(
788788
'hinclude_default_template' => array(
789789
'hinclude.html.twig',
790790
),
@@ -808,7 +808,7 @@ any global default template that is defined):
808808
new ControllerReference('...'),
809809
array(
810810
'renderer' => 'hinclude',
811-
'default' => 'default/content.html.twig',
811+
'default' => 'default/content.html.twig',
812812
)
813813
) ?>
814814
@@ -826,7 +826,7 @@ Or you can also specify a string to display as the default content:
826826
new ControllerReference('...'),
827827
array(
828828
'renderer' => 'hinclude',
829-
'default' => 'Loading...',
829+
'default' => 'Loading...',
830830
)
831831
) ?>
832832
@@ -999,13 +999,13 @@ but Symfony provides a more dynamic option via the ``asset`` Twig function:
999999

10001000
<img src="{{ asset('images/logo.png') }}" alt="Symfony!" />
10011001

1002-
<link href="{{ asset('css/blog.css') }}" rel="stylesheet" type="text/css" />
1002+
<link href="{{ asset('css/blog.css') }}" rel="stylesheet" />
10031003

10041004
.. code-block:: html+php
10051005

10061006
<img src="<?php echo $view['assets']->getUrl('images/logo.png') ?>" alt="Symfony!" />
10071007

1008-
<link href="<?php echo $view['assets']->getUrl('css/blog.css') ?>" rel="stylesheet" type="text/css" />
1008+
<link href="<?php echo $view['assets']->getUrl('css/blog.css') ?>" rel="stylesheet" />
10091009

10101010
The ``asset`` function's main purpose is to make your application more portable.
10111011
If your application lives at the root of your host (e.g. http://example.com),
@@ -1171,7 +1171,7 @@ is by default "web").
11711171

11721172
.. code-block:: html+jinja
11731173

1174-
<link href="{{ asset('bundles/acmedemo/css/contact.css') }}" rel="stylesheet" />
1174+
<link href="{{ asset('bundles/acmedemo/css/contact.css') }}" rel="stylesheet" />
11751175

11761176
The end result is a page that includes both the ``main.css`` and ``contact.css``
11771177
stylesheets.
@@ -1396,7 +1396,7 @@ One common way to use inheritance is to use a three-level approach. This
13961396
method works perfectly with the three different types of templates that were just
13971397
covered:
13981398

1399-
* Create a ``app/Resources/views/base.html.twig`` file that contains the main
1399+
* Create an ``app/Resources/views/base.html.twig`` file that contains the main
14001400
layout for your application (like in the previous example). Internally, this
14011401
template is called ``base.html.twig``;
14021402

@@ -1487,7 +1487,7 @@ tag to the screen:
14871487

14881488
.. code-block:: html
14891489

1490-
Hello &lt;script&gt;alert(&#39;helloe&#39;)&lt;/script&gt;
1490+
Hello &lt;script&gt;alert(&#39;hello!&#39;)&lt;/script&gt;
14911491

14921492
The Twig and PHP templating systems approach the problem in different ways.
14931493
If you're using Twig, output escaping is on by default and you're protected.

changelog.rst

+94
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,100 @@ 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+
May, 2015
17+
---------
18+
19+
New Documentation
20+
~~~~~~~~~~~~~~~~~
21+
22+
* `#5329 <https://github.com/symfony/symfony-docs/pull/5329>`_ Adding a new entry about deprecation warnings (weaverryan)
23+
* `#4604 <https://github.com/symfony/symfony-docs/pull/4604>`_ Making the channel handler more useful by showing it on the prod environment (weaverryan)
24+
* `#5155 <https://github.com/symfony/symfony-docs/pull/5155>`_ Documented upgrading path for a major version (WouterJ)
25+
* `#5127 <https://github.com/symfony/symfony-docs/pull/5127>`_ [VarDumper] Add doc for assertDump\* assertions (nicolas-grekas)
26+
* `#5137 <https://github.com/symfony/symfony-docs/pull/5137>`_ Added a note about the rotating_file monolog handler (javiereguiluz)
27+
* `#5283 <https://github.com/symfony/symfony-docs/pull/5283>`_ [BestPractices] restructured text format for the installation instructions template (xabbuh)
28+
* `#5298 <https://github.com/symfony/symfony-docs/pull/5298>`_ Completed framework config (WouterJ)
29+
* `#5255 <https://github.com/symfony/symfony-docs/pull/5255>`_ [Cookbook] Use configured user provider instead of injection (mvar)
30+
* `#5216 <https://github.com/symfony/symfony-docs/pull/5216>`_ [Cookbook] [Deployment] Added note about Nginx (phansys)
31+
* `#5169 <https://github.com/symfony/symfony-docs/pull/5169>`_ Removed synchronized services from Symfony 2.7 docs (javiereguiluz)
32+
* `#5117 <https://github.com/symfony/symfony-docs/pull/5117>`_ Complete review of the "Customize Error Pages" cookbook article (javiereguiluz)
33+
* `#5115 <https://github.com/symfony/symfony-docs/pull/5115>`_ Flesh out twig-template for custom data-collector (Darien Hager)
34+
* `#5106 <https://github.com/symfony/symfony-docs/pull/5106>`_ [VarDumper] upgrade doc to 2.7 wither interface (nicolas-grekas)
35+
* `#4728 <https://github.com/symfony/symfony-docs/pull/4728>`_ Add Session Cache Limiting section for NativeSessionStorage (mrclay)
36+
* `#4084 <https://github.com/symfony/symfony-docs/pull/4084>`_ [Book][Forms] describe the allow_extra_fields form option (xabbuh)
37+
* `#5294 <https://github.com/symfony/symfony-docs/pull/5294>`_ Tweaks to bower entry - specifically committing deps (weaverryan)
38+
* `#5062 <https://github.com/symfony/symfony-docs/pull/5062>`_ Cookbook about Command in Application with AnsiToHtml (Rvanlaak)
39+
* `#4901 <https://github.com/symfony/symfony-docs/pull/4901>`_ Removed the Internals chapter from the Symfony book (javiereguiluz)
40+
* `#4807 <https://github.com/symfony/symfony-docs/pull/4807>`_ [2.7] bumped min PHP version to 5.3.9 (xelaris)
41+
* `#4790 <https://github.com/symfony/symfony-docs/pull/4790>`_ [Cookbook][Routing] Update custom_route_loader.rst (xelaris)
42+
* `#5159 <https://github.com/symfony/symfony-docs/pull/5159>`_ Added an article explaining how to use Bower in Symfony (WouterJ)
43+
* `#4700 <https://github.com/symfony/symfony-docs/pull/4700>`_ add informations how to create a custom doctrine mapping (timglabisch)
44+
* `#4675 <https://github.com/symfony/symfony-docs/pull/4675>`_ [Serializer] Doc for groups support (dunglas)
45+
* `#5164 <https://github.com/symfony/symfony-docs/pull/5164>`_ Added information about the Symfony Demo application (javiereguiluz)
46+
* `#5100 <https://github.com/symfony/symfony-docs/pull/5100>`_ Change MySQL UTF-8 examples to use utf8mb4 (DHager, Darien Hager)
47+
* `#5088 <https://github.com/symfony/symfony-docs/pull/5088>`_ [Cookbook] Custom compile steps on Heroku (bicpi)
48+
* `#5005 <https://github.com/symfony/symfony-docs/pull/5005>`_ Renamed precision option to scale (WouterJ)
49+
50+
Fixed Documentation
51+
~~~~~~~~~~~~~~~~~~~
52+
53+
* `#5324 <https://github.com/symfony/symfony-docs/pull/5324>`_ 5259 improve 'Testing Documentation' in contributing guide (snoek09)
54+
* `#5328 <https://github.com/symfony/symfony-docs/pull/5328>`_ Update create_form_type_extension.rst (jackdelin)
55+
* `#5305 <https://github.com/symfony/symfony-docs/pull/5305>`_ [BestPractices][Security] revert #5271 on the 2.6 branch (xabbuh)
56+
* `#5251 <https://github.com/symfony/symfony-docs/pull/5251>`_ [Cookbook][Controller] replace docs for removed `forward()` method (xabbuh)
57+
* `#5237 <https://github.com/symfony/symfony-docs/pull/5237>`_ Update authentication.rst (taavit)
58+
* `#5299 <https://github.com/symfony/symfony-docs/pull/5299>`_ Command controller tweaks to #5062 (weaverryan)
59+
* `#5297 <https://github.com/symfony/symfony-docs/pull/5297>`_ Kernel Events Proofreading after #4901 (weaverryan)
60+
* `#5296 <https://github.com/symfony/symfony-docs/pull/5296>`_ Fix link to Zend Soap (peterkokot)
61+
* `#5266 <https://github.com/symfony/symfony-docs/pull/5266>`_ Update heroku.rst (nickbyfleet)
62+
* `#5270 <https://github.com/symfony/symfony-docs/pull/5270>`_ Use OptionsResolver (tacman)
63+
* `#5271 <https://github.com/symfony/symfony-docs/pull/5271>`_ Fix nonexistent controller method (amansilla)
64+
* `#4615 <https://github.com/symfony/symfony-docs/pull/4615>`_ Update NotBlank to reflect the actual validation (DRvanR)
65+
* `#5249 <https://github.com/symfony/symfony-docs/pull/5249>`_ [security][form login] fix translations for the security messages. (aitboudad)
66+
* `#5247 <https://github.com/symfony/symfony-docs/pull/5247>`_ [2.7] [Serializer] fixes the order of the Serializer constructor arguments. (hhamon)
67+
* `#5220 <https://github.com/symfony/symfony-docs/pull/5220>`_ Fix example namespace (lepiaf)
68+
* `#5203 <https://github.com/symfony/symfony-docs/pull/5203>`_ Order has one param without spaces (carlosbuenosvinos)
69+
* `#4273 <https://github.com/symfony/symfony-docs/pull/4273>`_ - fix doctrine version in How to Provide Model Classes for several Doctrine Implementations cookbook
70+
71+
Minor Documentation Changes
72+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
73+
74+
* `#5343 <https://github.com/symfony/symfony-docs/pull/5343>`_ [Reference][Forms] reorder index to match the description order (xabbuh)
75+
* `#5309 <https://github.com/symfony/symfony-docs/pull/5309>`_ [Cookbook][Controller] few tweaks to the error pages article (xabbuh)
76+
* `#5311 <https://github.com/symfony/symfony-docs/pull/5311>`_ Moved sections to be equal to index list (WouterJ)
77+
* `#5326 <https://github.com/symfony/symfony-docs/pull/5326>`_ Fixed code intentation (lyrixx)
78+
* `#5327 <https://github.com/symfony/symfony-docs/pull/5327>`_ [Platform] Made things more obvious and copy/paste friendly (lyrixx)
79+
* `#5338 <https://github.com/symfony/symfony-docs/pull/5338>`_ Text in index.html.twig for The Big Picture wrong (BT643)
80+
* `#5341 <https://github.com/symfony/symfony-docs/pull/5341>`_ fixed typo and added additional hit for NullOutput() (kuldipem)
81+
* `#5302 <https://github.com/symfony/symfony-docs/pull/5302>`_ Place DQL in front of QueryBuilder (alfonsomga)
82+
* `#5276 <https://github.com/symfony/symfony-docs/pull/5276>`_ Better illustrate what the "user mistake" is. (diamondsea)
83+
* `#5304 <https://github.com/symfony/symfony-docs/pull/5304>`_ Proofreading Javier's excellent updates - in some places, shortening some things (weaverryan)
84+
* `#5263 <https://github.com/symfony/symfony-docs/pull/5263>`_ Let docbot review the form docs (WouterJ)
85+
* `#5280 <https://github.com/symfony/symfony-docs/pull/5280>`_ Rebase #4633 (seangallavan)
86+
* `#5241 <https://github.com/symfony/symfony-docs/pull/5241>`_ [Components][Form] apply some fixes to the Form events chapter (xabbuh)
87+
* `#5233 <https://github.com/symfony/symfony-docs/pull/5233>`_ Improve Choice Validation Constraint Example (huebs)
88+
* `#5228 <https://github.com/symfony/symfony-docs/pull/5228>`_ Clarify `query_builder` closure return type (kix)
89+
* `#5165 <https://github.com/symfony/symfony-docs/pull/5165>`_ Minor changes to match the Symfony Demo reference application (javiereguiluz)
90+
* `#5281 <https://github.com/symfony/symfony-docs/pull/5281>`_ store templates under app/Resources/views (xabbuh)
91+
* `#5267 <https://github.com/symfony/symfony-docs/pull/5267>`_ fix infinity upper bound (xabbuh)
92+
* `#5277 <https://github.com/symfony/symfony-docs/pull/5277>`_ always refer to getcomposer.org through HTTPS (xabbuh)
93+
* `#4671 <https://github.com/symfony/symfony-docs/pull/4671>`_ consistent spelling (xabbuh)
94+
* `#4255 <https://github.com/symfony/symfony-docs/pull/4255>`_ Updated autoload standard to PSR-4. (phansys)
95+
* `#5278 <https://github.com/symfony/symfony-docs/pull/5278>`_ remove unnecessary code (karion)
96+
* `#5262 <https://github.com/symfony/symfony-docs/pull/5262>`_ Update Routes in the Getting Started documentation (BT643)
97+
* `#5178 <https://github.com/symfony/symfony-docs/pull/5178>`_ Usage of denyAccessUnlessGranted in the controller (94noni)
98+
* `#5229 <https://github.com/symfony/symfony-docs/pull/5229>`_ Remove mention of \*.class parameters from conventions (jvasseur)
99+
* `#5250 <https://github.com/symfony/symfony-docs/pull/5250>`_ [Cookbook][Logging] use straightforward instead of straigt forward (xabbuh)
100+
* `#5257 <https://github.com/symfony/symfony-docs/pull/5257>`_ Let docbot review the constraint docs (WouterJ)
101+
* `#5222 <https://github.com/symfony/symfony-docs/pull/5222>`_ Update service_container.rst (assoum891)
102+
* `#5221 <https://github.com/symfony/symfony-docs/pull/5221>`_ Update Uglifyjs.rst (assoum891)
103+
* `#5219 <https://github.com/symfony/symfony-docs/pull/5219>`_ Fix contradicting merging policy rules (lscholten)
104+
* `#5217 <https://github.com/symfony/symfony-docs/pull/5217>`_ Update _payload-option.rst.inc (bvleur)
105+
* `#5226 <https://github.com/symfony/symfony-docs/pull/5226>`_ Update http_cache.rst (assoum891)
106+
* `#5238 <https://github.com/symfony/symfony-docs/pull/5238>`_ Fixed typo and removed outdated imports (nomack84)
107+
* `#5240 <https://github.com/symfony/symfony-docs/pull/5240>`_ [Cookbook][Email] revert #4808 (xabbuh)
108+
109+
16110
April, 2015
17111
-----------
18112

components/dependency_injection/lazy_services.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ the `ProxyManager bridge`_:
3939

4040
.. code-block:: bash
4141
42-
$ php composer.phar require ocramius/proxy-manager:~0.5
42+
$ php composer.phar require ocramius/proxy-manager:~1.0
4343
4444
Afterwards compile your container and check to make sure that you get
4545
a proxy for your lazy services.

components/finder.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ And it also works with user-defined streams::
111111
use Symfony\Component\Finder\Finder;
112112

113113
$s3 = new \Zend_Service_Amazon_S3($key, $secret);
114-
$s3->registerStreamWrapper("s3");
114+
$s3->registerStreamWrapper('s3');
115115

116116
$finder = new Finder();
117117
$finder->name('photos*')->size('< 100K')->date('since 1 hour ago');

0 commit comments

Comments
 (0)