| 1 | <?php |
||
| 7 | class Alert |
||
| 8 | { |
||
| 9 | const INFO = 'info'; |
||
| 10 | const SUCCESS = 'success'; |
||
| 11 | const WARNING = 'warning'; |
||
| 12 | const DANGER = 'danger'; |
||
| 13 | const ALERT_TYPES = [ |
||
| 14 | self::INFO, |
||
| 15 | self::SUCCESS, |
||
| 16 | self::WARNING, |
||
| 17 | self::DANGER, |
||
| 18 | ]; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Create a new flash alert used for displaying info to users. |
||
| 22 | * |
||
| 23 | * @param string $message alert message content |
||
| 24 | * @param string $type alert type |
||
| 25 | */ |
||
| 26 | public static function add($message, $type = self::INFO) |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Retrieve previously added alerts to display them. |
||
| 39 | * |
||
| 40 | * @return array alerts |
||
| 41 | */ |
||
| 42 | public static function getAlerts() |
||
| 46 | } |
||
| 47 |