module shop, flash message

This commit is contained in:
2024-10-16 17:54:33 +03:00
parent 209b1e3f29
commit 9af44ca95f
12 changed files with 137 additions and 54 deletions

29
kernel/Flash.php Normal file
View File

@ -0,0 +1,29 @@
<?php
namespace kernel;
use Josantonius\Session\Facades\Session;
class Flash
{
public static function setMessage(string $type, string $msg): void
{
Session::start();
Session::set($type, $msg);
}
public static function getMessage(string $type): string
{
$msg = Session::get($type, false);
Session::remove($type);
return $msg;
}
public static function hasMessage(string $type): bool
{
return Session::has($type);
}
}