/** * Returns any previously flashed messages. * * @param bool $clear whether to delete the flashed messages from the session * @return array set of associative arrays with message, level keys */ public function getFlashed($clear = true) { $messages = $this->core->session()->get(static::SESSION_FLASH_KEY, []); if ($clear) { $this->core->session()->remove(static::SESSION_FLASH_KEY); } return $messages; }