Added docs for workflow_marked_places() function#7820
Closed
javiereguiluz wants to merge 4 commits intosymfony:masterfrom
Closed
Added docs for workflow_marked_places() function#7820javiereguiluz wants to merge 4 commits intosymfony:masterfrom
javiereguiluz wants to merge 4 commits intosymfony:masterfrom
Conversation
xabbuh
reviewed
Apr 19, 2017
workflow/usage.rst
Outdated
|
|
||
| .. versionadded:: 3.3 | ||
| The ``workflow_marked_places()`` and ``workflow_has_marked_place()`` | ||
| functions were added in Symfony 3.3. |
xabbuh
reviewed
Apr 19, 2017
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: |
Member
|
I think we can backport the listing to the 3.2 docs (omitting the two new Twig functions of course). |
Contributor
|
👍 for back porting 3.2 features. |
javiereguiluz
commented
Apr 19, 2017
workflow/usage.rst
Outdated
| {% endif %} | ||
|
|
||
| {# Get all the places related to the 'post' marking #} | ||
| {{ workflow_marked_places(post)|join(',') }} |
Member
Author
There was a problem hiding this comment.
This example is pretty stupid. Can you please suggest me an interesting and realistic example for workflow_marked_places()? Thanks!
Contributor
There was a problem hiding this comment.
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.
Member
Author
There was a problem hiding this comment.
Very nice! I added your example. Thanks!
Member
Author
|
Can you do the backporting while merging or should I make a new PR? |
Member
|
I can do that while merging. |
Member
|
Thank you Javier. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes #7785.