File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -538,6 +538,7 @@ Storing Metadata
538538----------------
539539
540540.. versionadded :: 4.1
541+
541542 The feature to store metadata in workflows was introduced in Symfony 4.1.
542543
543544In case you need it, you can store arbitrary metadata in workflows, their
@@ -639,9 +640,7 @@ requires:
639640 ),
640641 ));
641642
642- Then, you can access this metadata in your PHP code as follows:
643-
644- In your Controller::
643+ Then you can access this metadata in your controller as follows::
645644
646645 public function myControllerAction(Registry $registry, Article $article)
647646 {
@@ -676,14 +675,12 @@ There is a shortcut that works with everything::
676675In a Flash message in your Controller::
677676
678677 // $transition = ...; (an instance of Transition)
679- // $workflow is a WorkFlow instance retrieved from the Registry (see above)
678+ // $workflow is a Workflow instance retrieved from the Registry (see above)
680679 $title = $workflow->getMetadataStore()->getMetadata('title', $transition);
681680 $this->addFlash('info', "You have successfully applied the transition with title: '$title'");
682681
683682In a listener, access via the Event::
684683
685- <?php
686-
687684 namespace App\Listener\Workflow\Task;
688685
689686 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
You can’t perform that action at this time.
0 commit comments