8000 [Workflow] Update workflow.rst · symfony/symfony-docs@7be8735 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7be8735

Browse files
authored
[Workflow] Update workflow.rst
Added `workflow_transition_blockers` Twig function reference (from version 4.3)
1 parent 2a672a0 commit 7be8735

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

workflow.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,9 @@ of domain logic in your templates:
663663

664664
``workflow_has_marked_place()``
665665
Returns ``true`` if the marking of the given object has the given state.
666+
667+
``workflow_transition_blockers()``
668+
Returns :class:`Symfony\\Component\\Workflow\\TransitionBlockerList` for the given transition.
666669

667670
The following example shows these functions in action:
668671

@@ -695,6 +698,11 @@ The following example shows these functions in action:
695698
{% if 'reviewed' in workflow_marked_places(post) %}
696699
<span class="label">Reviewed</span>
697700
{% endif %}
701+
702+
{# Loop through the transition blockers #}
703+
{% for blocker in workflow_transition_blockers(post, 'publish') %}
704+
<span class="error">{{ blocker.message }}</span>
705+
{% endfor %}
698706

699707
Storing Metadata
700708
----------------

0 commit comments

Comments
 (0)
0