Hi @Sum
Yes you can use flash to display errors.
https://docs.phalcon.io/en/latest/reference/flash.html
In my project I use it like this.
$di->set(
'flashSession', function ()
{
return new Phalcon\Flash\Session(array(
'error' => 'alert alert-dismissable alert-danger',
'success' => 'alert alert-dismissable alert-success',
'notice' => 'alert alert-dismissable alert-info',
));
}
);
Then you can call
$this->flash->success("The post was correctly saved!");
This
'error' => 'alert alert-dismissable alert-danger',
is a reference to the css class representing the error.
This line of code is an example from bootstrap error.