Skip to content
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

Add completion for Symfony FlashBag types #13

Open
King2500 opened this issue Mar 26, 2017 · 0 comments
Open

Add completion for Symfony FlashBag types #13

King2500 opened this issue Mar 26, 2017 · 0 comments

Comments

@King2500
Copy link
Contributor

Today I thought about adding completion for Symfony FlashBag types ('error', 'info', etc) in Twig via PHP Toolbox for the new app.flashes method (and also the old app.session.flashBag.get one).

But there are a few deal breakers which stopped me from doing so:

To avoid a static list of FlashBag types (since it's user defined), it would be good to be able to get them from all Controller::addFlash and FlashBagInterface::set calls.
This requires: Haehnchen/idea-php-toolbox#41

Example usage:

// inside Controller:
$this->addFlash('error', 'Something went wrong');
{# inside Template #}
{% for message in app.flashes('<CARET>') %}
    <div class="alert alert-notice">
        {{ message }}
    </div>
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant