@@ -553,7 +553,8 @@ requires:
553553        framework : 
554554            workflows : 
555555                blog_publishing : 
556-                     metadata : ' Blog Publishing Workflow'  
556+                     metadata : 
557+                         title : ' Blog Publishing Workflow'  
557558                    #  ... 
558559                    places : 
559560                        draft : 
@@ -580,7 +581,7 @@ requires:
580581        > 
581582
582583            <framework : config > 
583-                 <framework : workflow  name =" blog_publishing"   type = " workflow "  
584+                 <framework : workflow  name =" blog_publishing"  
584585                    <framework : metadata > 
585586                        <framework : title >Blog Publishing Workflow</framework : title > 
586587                    </framework : metadata > 
@@ -646,9 +647,6 @@ In your Controller::
646647    { 
647648        $workflow = $registry->get($article); 
648649
649-         // Or, if you don't inject the Workflow Registry, fetch from the Container: 
650-         $workflow = $this->get('workflow.article'); 
651- 
652650        $workflow 
653651            ->getMetadataStore() 
654652            ->getWorkflowMetadata()['title'] ?? false 
@@ -678,8 +676,9 @@ There is a shortcut that works with everything::
678676In a Flash message in your Controller::
679677
680678            // $transition = ...; (an instance of Transition) 
681-             $title = $this->get('workflow.article')->getMetadataStore()->getMetadata('title', $transition); 
682-             $request->getSession()->getFlashBag()->add('info', "You have successfully applied the transition with title: '$title'"); 
679+             // $workflow is a WorkFlow instance retrieved from the Registry (see above) 
680+             $title = $workflow->getMetadataStore()->getMetadata('title', $transition); 
681+             $this->addFlash('info', "You have successfully applied the transition with title: '$title'"); 
683682
684683In a listener, access via the Event::
685684
@@ -691,7 +690,7 @@ In a listener, access via the Event::
691690    use Symfony\Component\Workflow\Event\GuardEvent; 
692691    use Symfony\Component\Workflow\TransitionBlocker; 
693692
694-     class DoneGuard  implements EventSubscriberInterface 
693+     class OverdueGuard  implements EventSubscriberInterface 
695694    { 
696695        public function guardPublish(GuardEvent $event) 
697696        { 
@@ -717,7 +716,7 @@ In a listener, access via the Event::
717716
718717In Twig templates, metadata is available via the ``workflow_metadata() `` function:
719718
720- .. code-block :: twig 
719+ .. code-block :: html+ twig
721720
722721    <h2>Metadata</h2>
723722    <p>
0 commit comments