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 @@ -688,15 +688,13 @@ In a Flash message in your Controller::
688
688
$title = $workflow->getMetadataStore()->getMetadata('title', $transition);
689
689
$this->addFlash('info', "You have successfully applied the transition with title: '$title'");
690
690
691
- In a listener, access via the Event
692
-
693
691
Metadata can also be accessed in a Listener, from the Event object.
694
692
695
- The example below uses a new feature introduced in 4.1 called Transition Blockers. These let you
693
+ Using transition blockers you can
696
694
return a user-friendly error message when you stop a transition from happening. In the example we
697
- get this user-friendly message from the Event's metadata, giving you an easy place to manage the
698
- text. This is a contrived example; in production systems you may prefer to use the
699
- :doc: `Translation </components/translation >` component to manage text ::
695
+ get this message from the :class: ` Symfony \\ Component \\ Workflow \\ Event\\ Event ` 's metadata, giving
696
+ you an easy place to manage the text. This is a contrived example; in production code you may
697
+ prefer to use the :doc: `Translation </components/translation >` component to manage messages ::
700
698
701
699
namespace App\Listener\Workflow\Task;
702
700
@@ -726,7 +724,9 @@ text. This is a contrived example; in production systems you may prefer to use t
726
724
}
727
725
}
728
726
727
+ .. versionadded :: 4.1
729
728
729
+ The transition blockers were added in version 4.1.
730
730
731
731
In Twig templates, metadata is available via the ``workflow_metadata() `` function:
732
732
You can’t perform that action at this time.
0 commit comments