igfs/kernel/Flash.php

29 lines
506 B
PHP
Raw Normal View History

2024-10-16 17:54:33 +03:00
<?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);
}
}