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 @@ -455,6 +455,7 @@ Storing Metadata
455455----------------
456456
457457.. versionadded :: 4.1
458+
458459 The feature to store metadata in workflows was introduced in Symfony 4.1.
459460
460461In case you need it, you can store arbitrary metadata in workflows, their
@@ -556,9 +557,7 @@ requires:
556557 ),
557558 ));
558559
559- Then, you can access this metadata in your PHP code as follows:
560-
561- In your Controller::
560+ Then you can access this metadata in your controller as follows::
562561
563562 public function myControllerAction(Registry $registry, Article $article)
564563 {
@@ -593,14 +592,12 @@ There is a shortcut that works with everything::
593592In a Flash message in your Controller::
594593
595594 // $transition = ...; (an instance of Transition)
596- // $workflow is a WorkFlow instance retrieved from the Registry (see above)
595+ // $workflow is a Workflow instance retrieved from the Registry (see above)
597596 $title = $workflow->getMetadataStore()->getMetadata('title', $transition);
598597 $this->addFlash('info', "You have successfully applied the transition with title: '$title'");
599598
600599In a listener, access via the Event::
601600
602- <?php
603-
604601 namespace App\Listener\Workflow\Task;
605602
606603 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
You can’t perform that action at this time.
0 commit comments