@@ -621,34 +621,34 @@ requires:
621
621
622
622
// config/packages/workflow.php
623
623
624
- $container->loadFromExtension('framework', [
625
- // ...
626
- 'workflows' => [
627
- 'blog_publishing' => [
628
- 'metadata' => [
629
- 'title' => 'Blog Publishing Workflow',
630
- ],
624
+ $container->loadFromExtension('framework', [
631
625
// ...
632
- 'places ' => [
633
- 'draft ' => [
626
+ 'workflows ' => [
627
+ 'blog_publishing ' => [
634
628
'metadata' => [
635
- 'max_num_of_words ' => 500 ,
629
+ 'title ' => 'Blog Publishing Workflow' ,
636
630
],
637
- ],
638
- // ...
639
- ],
640
- 'transitions' => [
641
- 'to_review' => [
642
- 'from' => 'draft',
643
- 'to' => 'review',
644
- 'metadata' => [
645
- 'priority' => 0.5,
631
+ // ...
632
+ 'places' => [
633
+ 'draft' => [
634
+ 'metadata' => [
635
+ 'max_num_of_words' => 500,
636
+ ],
637
+ ],
638
+ // ...
639
+ ],
640
+ 'transitions' => [
641
+ 'to_review' => [
642
+ 'from' => 'draft',
643
+ 'to' => 'review',
644
+ 'metadata' => [
645
+ 'priority' => 0.5,
646
+ ],
647
+ ],
646
648
],
647
649
],
648
650
],
649
- ],
650
- ],
651
- ]);
651
+ ]);
652
652
653
653
Then you can access this metadata in your controller as follows::
654
654
@@ -694,12 +694,12 @@ Metadata can also be accessed in a Listener, from the Event object.
694
694
Using transition blockers you can
695
695
return a user-friendly error message when you stop a transition from happening. In the example we
696
696
get this message from the :class: `Symfony\\ Component\\ Workflow\\ Event\\ Event `'s metadata, giving
697
- you an easy place to manage the text.
697
+ you a central place to manage the text.
698
698
699
699
.. tip ::
700
700
701
- This is a simple example; in production you may prefer to use the :doc: `Translation </components/translation >`
702
- component to manage messages in one place::
701
+ This is a simple example; in production you may prefer to use the :doc: `Translation </components/translation >`
702
+ component to manage messages in one place::
703
703
704
704
namespace App\L istener\W orkflow\T ask;
705
705
@@ -731,7 +731,7 @@ component to manage messages in one place::
731
731
732
732
.. versionadded :: 4.1
733
733
734
- The transition blockers were added in version 4.1.
734
+ The transition blockers were introduced in version 4.1.
735
735
736
736
In Twig templates, metadata is available via the ``workflow_metadata() `` function:
737
737
0 commit comments