Exemplo n.º 1
0
 /**
  * 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();
 }
Exemplo n.º 2
0
 /**
  * Clears the Notices queue
  */
 public function action_clear()
 {
     Notices::clear(NULL, NULL, NULL);
     echo '<p>Number of notices in queue: ' . Notices::count() . '</p>';
 }