Skip to content

Commit a871413

Browse files
committed
minor #13971 [Workflow] Update workflow.rst (LiLinen)
This PR was merged into the 4.4 branch. Discussion ---------- [Workflow] Update workflow.rst Added `workflow_transition_blockers()` Twig function reference (from version 4.3) Commits ------- 7be8735 [Workflow] Update workflow.rst
2 parents 2a672a0 + 7be8735 commit a871413

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)