" . $value . ""; } return $return; } public static function recErrorInput(string $_string) { if (empty($_SESSION["alert"]["input"])) { $_SESSION["alert"]["input"] = array(); } array_push($_SESSION["alert"]["input"], $_string); } public static function ifErrorInput(string $_string) { return (in_array($_string, $_SESSION["alert"]["input"])) ? TRUE : FALSE; } private static function printToast(string $_style, string $_icon, array $_texte) { echo ' '; } public static function show() { if (self::getSuccess() or self::getError()) { echo '
'; if (self::getSuccess()) { $style = 'background:#d4edda;'; $icon = ' Succès'; $texte = self::getSuccess(); self::printToast($style, $icon, $texte); } if (self::getError()) { $style = 'background:#f8d7da;'; $icon = ' Erreur'; $texte = self::getError(); self::printToast($style, $icon, $texte); } echo '
'; } self::destroyAlert(); } public static function destroyAlert() { unset($_SESSION["alert"]); } }