29 lines
		
	
	
		
			506 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			506 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?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);
 | 
						|
    }
 | 
						|
 | 
						|
} |