/** * Displays notifications * * If notification type omitted, displays all notification types * * @param string Notification type * @param string View type * @return void */ public static function render($type = NULL, $view = NULL) { switch ($view) { case 'json': $output = json_encode(Notice::as_array($type)); break; default: $output = View::factory(Notice::$view)->set('notifications', Notice::as_array($type))->render(); } // Clear the notifications after rendering Notice::clear($type); return $output; }
/** * Returns notices * * @return string */ public function notices() { return Notice::as_array(); }