-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Added docs for workflow_marked_places() function #7820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
workflow/usage.rst
Outdated
|
||
.. versionadded:: 3.3 | ||
The ``workflow_marked_places()`` and ``workflow_has_marked_place()`` | ||
functions were added in Symfony 3.3. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[...] were introduced [...]
workflow/usage.rst
Outdated
The ``workflow_marked_places()`` and ``workflow_has_marked_place()`` | ||
functions were added in Symfony 3.3. | ||
|
||
The following example shows these methods in action: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
functions
I think we can backport the listing to the 3.2 docs (omitting the two new Twig functions of course). |
👍 for back porting 3.2 features. |
workflow/usage.rst
Outdated
@@ -277,3 +294,6 @@ The links below will only be displayed when the action is allowed: | |||
{% if workflow_has_marked_place(post, 'to_review') %} | |||
<p>This post is ready for review.</p> | |||
{% endif %} | |||
|
|||
{# Get all the places related to the 'post' marking #} | |||
{{ workflow_marked_places(post)|join(',') }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example is pretty stupid. Can you please suggest me an interesting and realistic example for workflow_marked_places()
? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about something like:
{% if 'waiting_some_approval' in workflow_marked_places(post) %}
<span class="special-label"></span>
{% endif %}
Many places may be needed for a "can", but some times, only one to display things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! I added your example. Thanks!
Can you do the backporting while merging or should I make a new PR? |
I can do that while merging. |
Thank you Javier. |
This fixes #7785.