Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit83428ee

Browse files
committed
minor#13907 [Workflow] Added function to get a specific transition (epitre)
This PR was merged into the 5.2 branch.Discussion----------[Workflow] Added function to get a specific transitionCommits-------9b704d5 Added function to get a specific transition
2 parentse3c0282 +9b704d5 commit83428ee

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

‎workflow.rst‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ what actions are allowed on a blog post::
232232

233233
// See all the available transitions for the post in the current state
234234
$transitions = $workflow->getEnabledTransitions($post);
235+
// See a specific available transition for the post in the current state
236+
$transition = $workflow->getEnabledTransition($post, 'publish');
235237

236238
Accessing the Workflow in a Class
237239
---------------------------------
@@ -788,6 +790,9 @@ of domain logic in your templates:
788790
``workflow_transitions()``
789791
Returns an array with all the transitions enabled for the given object.
790792

793+
``workflow_transition()``
794+
Returns a specific transitions enabled for the given object and transition name.
795+
791796
``workflow_marked_places()``
792797
Returns an array with the place names of the given marking.
793798

@@ -1031,6 +1036,15 @@ In Twig templates, metadata is available via the ``workflow_metadata()`` functio
10311036
{% endfor %}
10321037
</ul>
10331038
</p>
1039+
<p>
1040+
<strong>to_review Priority</strong>
1041+
<ul>
1042+
<li>
1043+
to_review:
1044+
<code>{{ workflow_metadata(blog_post, 'priority', workflow_transition(blog_post, 'to_review')) }}</code>
1045+
</li>
1046+
</ul>
1047+
</p>
10341048

10351049
Learn more
10361050
----------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp