Skip to content

Commit f9ee5a1

Browse files
committed
Incorporate @OskarStark's feedback
1 parent d926caa commit f9ee5a1

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
@@ -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

460461
In 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::
593592
In 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

600599
In a listener, access via the Event::
601600

602-
<?php
603-
604601
namespace App\Listener\Workflow\Task;
605602

606603
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

0 commit comments

Comments
 (0)