projet par cursor
This commit is contained in:
1 parent
236f75ecdd
commit
b785db1b84
47 files changed
+3902
No files matched your search
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
final class Flash
|
||||
{
|
||||
private const CLE = "_flash";
|
||||
|
||||
public static function definir(string $type, string $message): void
|
||||
{
|
||||
$_SESSION[self::CLE] = [
|
||||
"type" => $type,
|
||||
"message" => $message
|
||||
];
|
||||
}
|
||||
|
||||
public static function consommer(): ?array
|
||||
{
|
||||
if (empty($_SESSION[self::CLE]))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$flash = $_SESSION[self::CLE];
|
||||
unset($_SESSION[self::CLE]);
|
||||
|
||||
return $flash;
|
||||
}
|
||||
}
|
||||