8000 Added docs for workflow_marked_places() function by javiereguiluz · Pull Request #7820 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

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

Closed
wants to merge 4 commits into from

Conversation

javiereguiluz
Copy link
Member

This fixes #7785.


.. versionadded:: 3.3
The ``workflow_marked_places()`` and ``workflow_has_marked_place()``
functions were added in Symfony 3.3.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[...] were introduced [...]

The ``workflow_marked_places()`` and ``workflow_has_marked_place()``
functions were added in Symfony 3.3.

The following example shows these methods in action:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

functions

@xabbuh
Copy link
Member
xabbuh commented Apr 19, 2017

I think we can backport the listing to the 3.2 docs (omitting the two new Twig functions of course).

@HeahDude
Copy link
Contributor

👍 for back porting 3.2 features.

@@ -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(',') }}
Copy link
Member Author

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!

Copy link
Contributor

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.

Copy link
Member Author

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!

@javiereguiluz
Copy link
Member Author

Can you do the backporting while merging or should I make a new PR?

@xabbuh
Copy link
Member
xabbuh commented Apr 20, 2017

I can do that while merging.

@xabbuh
Copy link
Member
xabbuh commented May 8, 2017

Thank you Javier.

@xabbuh xabbuh closed this in 72bd8ed May 8, 2017
xabbuh added a commit that referenced this pull request May 8, 2017
…reguiluz)

This PR was squashed before being merged into the master branch (closes #7820).

Discussion
----------

Added docs for workflow_marked_places() function

This fixes #7785.

Commits
-------

09983c5 Added docs for workflow_marked_places() function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Workflow] Added workflow_marked_places() twig function
4 participants
0