Skip to content

Commit d781027

Browse files
committed
Merge branch '3.4' into 4.1
* 3.4: Teach the user to write the command lazy loading [#10480] reuse wording from multi kernel article Update Multiple_kernels.rst Update usage.rst add annotation block to routing conditions Fix example for collection form type Update micro_kernel_trait.rst Update configuration/micro_kernel_trait.rst Update to micro_kernel_trait.rst
2 parents 5413293 + b02c3c7 commit d781027

File tree

5 files changed

+34
-8
lines changed

5 files changed

+34
-8
lines changed

configuration/micro_kernel_trait.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ your ``composer.json`` file to load from there:
124124
}
125125
}
126126
127+
Then, run ``composer dump-autoload`` to dump your new autoload config.
128+
127129
Now, suppose you want to use Twig and load routes via annotations. Instead of
128130
putting *everything* in ``index.php``, create a new ``src/Kernel.php`` to
129131
hold the kernel. Now it looks like this::

console.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ want a command to create a user::
3535

3636
class CreateUserCommand extends Command
3737
{
38+
// the name of the command (the part after "bin/console")
39+
protected static $defaultName = 'app:create-user';
40+
3841
protected function configure()
3942
{
4043
// ...
@@ -57,9 +60,6 @@ method. Then you can optionally define a help message and the
5760
protected function configure()
5861
{
5962
$this
60-
// the name of the command (the part after "bin/console")
61-
->setName('app:create-user')
62-
6363
// the short description shown while running "php bin/console list"
6464
->setDescription('Creates a new user.')
6565

reference/forms/types/collection.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,8 @@ you need is this JavaScript code:
147147
jQuery(document).ready(function () {
148148
jQuery('.add-another-collection-widget').click(function (e) {
149149
var list = jQuery(jQuery(this).attr('data-list'));
150-
// Try to find the counter of the list
150+
// Try to find the counter of the list or use the length of the list
151151
var counter = list.data('widget-counter') | list.children().length;
152-
// If the counter does not exist, use the length of the list
153-
if (!counter) { counter = list.children().length; }
154152
155153
// grab the prototype template
156154
var newWidget = list.attr('data-prototype');
@@ -161,7 +159,7 @@ you need is this JavaScript code:
161159
// Increase the counter
162160
counter++;
163161
// And store it, the length cannot be used if deleting widgets is allowed
164-
list.data(' widget-counter', counter);
162+
list.data('widget-counter', counter);
165163
166164
// create a new list element and add it to the list
167165
var newElem = jQuery(list.attr('data-widget-tags')).html(newWidget);

routing/conditions.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,32 @@ define arbitrary matching logic, use the ``conditions`` routing option:
1010

1111
.. configuration-block::
1212

13+
.. code-block:: php-annotations
14+
15+
// src/Controller/DefaultController.php
16+
namespace App\Controller;
17+
18+
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
19+
use Symfony\Component\Routing\Annotation\Route;
20+
21+
class DefaultController extends AbstractController
22+
{
23+
/**
24+
* @Route(
25+
* "/contact",
26+
* name="contact",
27+
* condition="context.getMethod() in ['GET', 'HEAD'] and request.headers.get('User-Agent') matches '/firefox/i'"
28+
* )
29+
*
30+
* expressions can also include config parameters
31+
* condition: "request.headers.get('User-Agent') matches '%app.allowed_browsers%'"
32+
*/
33+
public function contact()
34+
{
35+
// ...
36+
}
37+
}
38+
1339
.. code-block:: yaml
1440
1541
# config/routes.yaml

workflow/usage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ The following example shows these functions in action:
467467
{% endfor %}
468468
469469
{# Check if the object is in some specific place #}
470-
{% if workflow_has_marked_place(post, 'to_review') %}
470+
{% if workflow_has_marked_place(post, 'review') %}
471471
<p>This post is ready for review.</p>
472472
{% endif %}
473473

0 commit comments

Comments
 (0)