cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[NFR] Make `$type` parameter of \Phalcon\Flash\Session::has(string $type) optional

Open shark0der opened this issue 12 years ago • 2 comments

It should be possible to check if the session flash has any type of messages. Right now I had to use this ugly workaround in order to prevent the rendering of an empty div.notification (which doesn't look OK if empty):

{% if flash.getMessages(null, false) %}
    <div class="notification">
        {{ flash.output() }}
    </div>
{% endif %}

The new functionality would allow doing this:

{% if flash.has() %}
    <div class="notification">
        {{ flash.output() }}
    </div>
{% endif %}

Want to back this issue? Place a bounty on it! We accept bounties via Bountysource.

shark0der avatar Aug 15 '14 01:08 shark0der

@shark0der Good news! ;) I have tested it just now and it works without any parameter too! So unless this is how developers wanted it to be, only the API docs should be changed.

Conradaek avatar Sep 09 '14 17:09 Conradaek

This is fixed in 2.0.0

ghost avatar Nov 13 '14 19:11 ghost