File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -605,15 +605,13 @@ In a Flash message in your Controller::
605
605
$title = $workflow->getMetadataStore()->getMetadata('title', $transition);
606
606
$this->addFlash('info', "You have successfully applied the transition with title: '$title'");
607
607
608
- In a listener, access via the Event
609
-
610
608
Metadata can also be accessed in a Listener, from the Event object.
611
609
612
- The example below uses a new feature introduced in 4.1 called Transition Blockers. These let you
610
+ Using transition blockers you can
613
611
return a user-friendly error message when you stop a transition from happening. In the example we
614
- get this user-friendly message from the Event's metadata, giving you an easy place to manage the
615
- text. This is a contrived example; in production systems you may prefer to use the
616
- :doc: `Translation </components/translation >` component to manage text ::
612
+ get this message from the :class: ` Symfony \\ Component \\ Workflow \\ Event\\ Event ` 's metadata, giving
613
+ you an easy place to manage the text. This is a contrived example; in production code you may
614
+ prefer to use the :doc: `Translation </components/translation >` component to manage messages ::
617
615
618
616
namespace App\Listener\Workflow\Task;
619
617
@@ -643,7 +641,9 @@ text. This is a contrived example; in production systems you may prefer to use t
643
641
}
644
642
}
645
643
644
+ .. versionadded :: 4.1
646
645
646
+ The transition blockers were added in version 4.1.
647
647
648
648
In Twig templates, metadata is available via the ``workflow_metadata() `` function:
649
649
You can’t perform that action at this time.
0 commit comments