/**
* Sets a flash notice
*
* @param string $level The level of the message: success, warning, danger
* @param string $message The message
*/
public function setFlash($level, $message)
{
if (!$this->request->hasSession()) {
$this->request->setSession(new Session());
}
$this->flash_notices[] = ['level' => $level, 'message' => $message];
$this->request->getSession()->getFlashBag()->set('notice', $this->flash_notices);
}