cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

Don't exist method output() ($this->flash->output()) in View.

Open Cmssspl opened this issue 13 years ago • 3 comments

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.

Cmssspl avatar Apr 22 '13 10:04 Cmssspl

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.

ghost avatar Apr 22 '13 14:04 ghost

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

Cmssspl avatar Apr 22 '13 14:04 Cmssspl

Some users register the flash session service as just "flash":

$di['flash'] = function(){
    return new Phalcon\Flash\Session();
};

ghost avatar Apr 22 '13 14:04 ghost