File tree Expand file tree Collapse file tree 6 files changed +76
-52
lines changed
Filter options
components/expression_language Expand file tree Collapse file tree 6 files changed +76
-52
lines changed
Original file line number Diff line number Diff line change @@ -487,52 +487,6 @@ To get the Profiler for the last request, do the following::
487
487
For specific details on using the profiler inside a test, see the
488
488
:doc: `/cookbook/testing/profiling ` cookbook entry.
489
489
490
- To avoid collecting data in each test you can set the ``collect `` parameter
491
- in the configuration:
492
-
493
- .. configuration-block ::
494
-
495
- .. code-block :: yaml
496
-
497
- # app/config/config_test.yml
498
-
499
- # ...
500
- framework :
501
- profiler :
502
- enabled : true
503
- collect : false
504
-
505
- .. code-block :: xml
506
-
507
- <!-- app/config/config.xml -->
508
- <?xml version =" 1.0" encoding =" UTF-8" ?>
509
- <container xmlns =" http://symfony.com/schema/dic/services"
510
- xmlns : framework =" http://symfony.com/schema/dic/symfony"
511
- xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
512
- xsi : schemaLocation =" http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
513
- http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
514
-
515
- <!-- ... -->
516
-
517
- <framework : config >
518
- <framework : profiler enabled =" true" collect =" false" />
519
- </framework : config >
520
- </container >
521
-
522
- .. code-block :: php
523
-
524
- // app/config/config.php
525
-
526
- // ...
527
- $container->loadFromExtension('framework', array(
528
- 'profiler' => array(
529
- 'enabled' => true,
530
- 'collect' => false,
531
- ),
532
- ));
533
-
534
- In this way only tests that call ``enableProfiler() `` will collect data.
535
-
536
490
Redirecting
537
491
~~~~~~~~~~~
538
492
Original file line number Diff line number Diff line change @@ -35,11 +35,7 @@ This method has 3 arguments:
35
35
36
36
$language = new ExpressionLanguage();
37
37
$language->register('lowercase', function ($str) {
38
- if (!is_string($str)) {
39
- return $str;
40
- }
41
-
42
- return sprintf('strtolower(%s)', $str);
38
+ is_string(%1$s) ? strtolower(%1$s) : %1$s;
43
39
}, function ($arguments, $str) {
44
40
if (!is_string($str)) {
45
41
return $str;
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ your overridden method wouldn't match anymore and generate a fatal error.
138
138
.. note ::
139
139
140
140
As with interfaces, we limit ourselves to changes that can be upgraded
141
- easily. We will document the precise ugprade instructions in the UPGRADE
141
+ easily. We will document the precise upgrade instructions in the UPGRADE
142
142
file in Symfony's root directory.
143
143
144
144
In some cases, only specific properties and methods are tagged with the ``@api ``
@@ -307,6 +307,9 @@ Add type hint to an argument Yes Yes
307
307
Remove type hint of an argument Yes Yes
308
308
Change argument type Yes Yes
309
309
Change return type Yes Yes
310
+ **Static Methods **
311
+ Turn non static into static No No
312
+ Turn static into non static No No
310
313
================================================== ============== ==============
311
314
312
315
.. [1 ] Your code may be broken by changes in the Symfony code. Such changes will
Original file line number Diff line number Diff line change @@ -38,6 +38,11 @@ application:
38
38
set req.http.Surrogate-Capability = "abc=ESI/1.0";
39
39
}
40
40
41
+ .. note ::
42
+
43
+ The ``abc `` part of the header isn't important unless you have multiple "surrogates"
44
+ that need to advertise their capabilities. See `Surrogate-Capability Header `_ for details.
45
+
41
46
Then, optimize Varnish so that it only parses the Response contents when there
42
47
is at least one ESI tag by checking the ``Surrogate-Control `` header that
43
48
Symfony2 adds automatically:
@@ -217,3 +222,4 @@ absolute URLs:
217
222
.. _`Varnish` : https://www.varnish-cache.org
218
223
.. _`Edge Architecture` : http://www.w3.org/TR/edge-arch
219
224
.. _`GZIP and Varnish` : https://www.varnish-cache.org/docs/3.0/phk/gzip.html
225
+ .. _`Surrogate-Capability Header` : http://www.w3.org/TR/edge-arch
Original file line number Diff line number Diff line change @@ -298,6 +298,22 @@ When the ``form.age`` widget is rendered, Symfony will use the ``integer_widget`
298
298
block from the new template and the ``input `` tag will be wrapped in the
299
299
``div `` element specified in the customized block.
300
300
301
+ Multiple Templates
302
+ ..................
303
+
304
+ A form can also be customized by applying several templates. To do this, pass the
305
+ name of all the templates as an array using the ``with `` keyword:
306
+
307
+ .. code-block :: html+jinja
308
+
309
+ {% form_theme form with ['::common.html.twig', ':Form: fields.html.twig',
310
+ 'AcmeDemoBundle:Form: fields.html.twig'] %}
311
+
312
+ {# ... #}
313
+
314
+ The templates can be located at different bundles and they can even be stored
315
+ at the global ``app/Resources/views/ `` directory.
316
+
301
317
Child Forms
302
318
...........
303
319
Original file line number Diff line number Diff line change @@ -73,3 +73,52 @@ finish. It's easy to achieve if you embed the token in the error message::
73
73
74
74
Read the API for built-in :doc: `data collectors </cookbook/profiler/data_collector >`
75
75
to learn more about their interfaces.
76
+
77
+ Speeding up Tests by not Collecting Profiler Data
78
+ -------------------------------------------------
79
+
80
+ To avoid collecting data in each test you can set the ``collect `` parameter
81
+ to false:
82
+
83
+ .. configuration-block ::
84
+
85
+ .. code-block :: yaml
86
+
87
+ # app/config/config_test.yml
88
+
89
+ # ...
90
+ framework :
91
+ profiler :
92
+ enabled : true
93
+ collect : false
94
+
95
+ .. code-block :: xml
96
+
97
+ <!-- app/config/config.xml -->
98
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
99
+ <container xmlns =" http://symfony.com/schema/dic/services"
100
+ xmlns : framework =" http://symfony.com/schema/dic/symfony"
101
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
102
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
103
+ http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
104
+
105
+ <!-- ... -->
106
+
107
+ <framework : config >
108
+ <framework : profiler enabled =" true" collect =" false" />
109
+ </framework : config >
110
+ </container >
111
+
112
+ .. code-block :: php
113
+
114
+ // app/config/config.php
115
+
116
+ // ...
117
+ $container->loadFromExtension('framework', array(
118
+ 'profiler' => array(
119
+ 'enabled' => true,
120
+ 'collect' => false,
121
+ ),
122
+ ));
123
+
124
+ In this way only tests that call ``$client->enableProfiler() `` will collect data.
You can’t perform that action at this time.
0 commit comments