Leaf PHP

Flash
in package

Leaf Flash ----- Simple flash messages for your leaf apps

Tags
author

Michael Darko mickdd22@gmail.com

since
2.5.0

Table of Contents

Properties

$config  : mixed

Methods

clearSaved()  : mixed
Clear the saved flash message
config()  : mixed
Configure leaf flash
display()  : string
Display a flash message
displaySaved()  : mixed
Display the saved flash message
remove()  : void
Manually remove set flash message
save()  : mixed
Save a flash message (won't delete after view).
set()  : mixed
Set a new flash message
unset()  : mixed
Remove a flash message
get()  : string|array<string|int, mixed>
Get the flash array

Properties

$config

private static mixed $config = ['key' => 'leaf.flash', 'default' => 'message', 'saved' => 'leaf.flashSaved']

Methods

clearSaved()

Clear the saved flash message

public static clearSaved() : mixed

config()

Configure leaf flash

public static config(array<string|int, mixed> $config) : mixed
Parameters
$config : array<string|int, mixed>

Configuration for leaf flash

display()

Display a flash message

public static display([string $key = 'default' ]) : string
Parameters
$key : string = 'default'

The key of message to display

Return values
string

displaySaved()

Display the saved flash message

public static displaySaved() : mixed

remove()

Manually remove set flash message

public static remove() : void

save()

Save a flash message (won't delete after view).

public static save(string $message) : mixed

You can save only one message at a time.

Parameters
$message : string

The flash message to save

set()

Set a new flash message

public static set(mixed $message[, string $key = 'default' ]) : mixed
Parameters
$message : mixed

The flash message to set

$key : string = 'default'

The key to save message

unset()

Remove a flash message

public static unset([string|null $key = null ]) : mixed
Parameters
$key : string|null = null

The key of message to remove

get()

Get the flash array

protected static get([string|null $key = null ]) : string|array<string|int, mixed>
Parameters
$key : string|null = null

The key of message to get

Return values
string|array<string|int, mixed>

        
On this page

Search results