cphalcon
cphalcon copied to clipboard
[NFR] Make `$type` parameter of \Phalcon\Flash\Session::has(string $type) optional
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 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.
This is fixed in 2.0.0