1. Go to this page and download the library: Download ideaglory/flash library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ideaglory / flash example snippets
$flash = new Flash();
$flash->set([
['text' => 'Account created successfully!', 'type' => Flash::SUCCESS]
]);
$data = $flash->display();
foreach ($data['messages'] as $message) {
echo "<div class='alert alert-{$message['type']}'>{$message['text']}</div>";
}
$flash = new Flash();
// Set initial message
$flash->set([
['text' => 'Initial notification.', 'type' => Flash::INFO]
]);
$data = $flash->display();
foreach ($data['messages'] as $message) {
echo "<div class='alert alert-{$message['type']}'>{$message['text']}</div>";
}
// Set new data for the next page
$flash->set([
['text' => 'Message for the next request.', 'type' => Flash::SUCCESS]
]);