/** * Prints an alert list for the given type. * * @param array $type The type of alerts to show. * @param array $options Options to use for alerts. * * @return View */ public static function alerts($type = 'all', array $options = array()) { $alerts = array(); if ($type == 'all') { $alerts['success'] = Session::get_flash('alert.success'); $alerts['info'] = Session::get_flash('alert.info'); $alerts['error'] = Session::get_flash('alert.error'); } else { $alerts[$type] = Session::get_flash('alert.' . $type); } Session::delete_flash('alert'); return View::forge('common/alerts', array('type' => $type, 'alerts' => $alerts, 'options' => $options)); }