cphalcon
cphalcon copied to clipboard
Don't exist method output() ($this->flash->output()) in View.
Volt file:
flash.output()
Compile to:
$this->flash->output()
Error: Don't exist method output()
If im change
$this->flash->output()
to
$this->flashSession->output()
Working properly.
This is not a bug, Phalcon\Flash\Direct doesn't need that method because the output is directly generated by the flasher so there is no need to explicitly output the messages in the views.
So this is confusing:
{# Inject the 'flash' service #}
<div id="messages">{{ flash.output() }}</div>
{# Inject the 'security' service #}
<input type="hidden" name="token" value="{{ security.getToken() }}">
In https://phalcon-php-framework-documentation.readthedocs.org/en/0.9.0/reference/volt.html
Some users register the flash session service as just "flash":
$di['flash'] = function(){
return new Phalcon\Flash\Session();
};