/** * Retrieves the notices form the session and stores them in the static * notices array. It also clears notices that have already been rendered. */ public static function init() { // Fetch notices from Session Notices::$notices = Session::instance()->get('notices', array()); // Clear all the non-persistent notices that have already been rendered Notices::clear(); // Set all the current notices to not-rendered foreach (Notices::$notices as $notice) { $notice->set_rendered_state(FALSE); } // Save the notices! Notices::save(); }
/** * Clears the Notices queue */ public function action_clear() { Notices::clear(NULL, NULL, NULL); echo '<p>Number of notices in queue: ' . Notices::count() . '</p>'; }