Example #1
0
 /**
  * @return bool
  */
 function run()
 {
     $this->id = "ALERT-" . time();
     $message = $this->message ? $this->message : Alerts::getMessage();
     $alert_type = $this->alert_type ? $this->alert_type : Alerts::getAlertType();
     $this->countdown = $this->countdown ? $this->countdown : Alerts::getCountdown();
     if (!$alert_type) {
         $alert_type = Alerts::ALERT_INFO;
     }
     if ($message) {
         /* ~ Clears message after use */
         Alerts::clearMessage();
         return $this->render('alerts', ['id' => $this->id, 'message' => $message, 'alert_type' => $alert_type, 'close' => $this->close, 'countdown' => $this->countdown]);
     }
     return FALSE;
 }