card action
This commit is contained in:
@ -9,12 +9,13 @@ class Flash
|
||||
|
||||
public static function setMessage(string $type, string $msg): void
|
||||
{
|
||||
Session::start();
|
||||
self::start();
|
||||
Session::set($type, $msg);
|
||||
}
|
||||
|
||||
public static function getMessage(string $type): string
|
||||
{
|
||||
self::start();
|
||||
$msg = Session::get($type, false);
|
||||
Session::remove($type);
|
||||
|
||||
@ -23,7 +24,16 @@ class Flash
|
||||
|
||||
public static function hasMessage(string $type): bool
|
||||
{
|
||||
self::start();
|
||||
|
||||
return Session::has($type);
|
||||
}
|
||||
|
||||
public static function start()
|
||||
{
|
||||
if (!Session::isStarted()){
|
||||
Session::start();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user