Skip to content

Commit c9ef262

Browse files
committed
Incorporate @OskarStark's feedback
1 parent c595c47 commit c9ef262

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

workflow/usage.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff 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

543544
In 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::
676675
In 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

683682
In a listener, access via the Event::
684683

685-
<?php
686-
687684
namespace App\Listener\Workflow\Task;
688685

689686
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

0 commit comments

Comments
 (0)