PHPFUI requires one session variable to validate requests for a CSRF attach. The Session class wraps the details for the library.
PHPFUI also provides basic flash support for subsequent requests in the same session.
Usage
\PHPFUI\Session::setFlash('error', 'That was nasty!');
Next request:
\PHPFUI\Session::cycleFlash();
$flash = \PHPFUI\Session::getflash('error');
if ($flash)
{
$callout = new \PHPFUI\Callout('alert');
$callout->add($flash);
}
Constants |
public PHPFUI |
public PHPFUI |
Methods |
public static checkCSRF(string $request = '') : bool |
public static csrf(string $quote = '') : string |
public static csrfField() : string |
public static cycleFlash() : void Loads the flash from the previous page and removes it for the next |
public static getFlash(string $key = '') : ?mixed Return the flash for the key provided |
public static setFlash(string $key, ?mixed $value = NULL) : void Set a flash for the next request. You can sent multiple flashes by specifying different keys
|
public static setHandler(PHPFUI Set the session handler if you are not using the default |
Properties |
private static array $flash = []
|
private static ?PHPFUI |
Methods |
private static getHandler() : PHPFUI Get the current handler |
Properties |
private static array $flash = []
|
private static ?PHPFUI |
Methods |
public static checkCSRF(string $request = '') : bool |
public static csrf(string $quote = '') : string |
public static csrfField() : string |
public static cycleFlash() : void Loads the flash from the previous page and removes it for the next |
public static getFlash(string $key = '') : ?mixed Return the flash for the key provided |
private static getHandler() : PHPFUI Get the current handler |
public static setFlash(string $key, ?mixed $value = NULL) : void Set a flash for the next request. You can sent multiple flashes by specifying different keys
|
public static setHandler(PHPFUI Set the session handler if you are not using the default |