PHP code example of gobline / flash
1. Go to this page and download the library: Download gobline/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/ */
gobline / flash example snippets
$flash = new Gobline\Flash\Flash();
$flash->initialize();
$flash->next('error', 'User email is invalid'); // sets a message that will be available in the next request
$flash->get('error'); // message only available in the next request, throws \InvalidArgumentException
$flash->get('error', 'foo'); // message only available in the next request, returns default "foo" value
$flash->now('info', 'Three credits remain in your account'); // message available in the current request
$flash->get('info'); // returns "Three credits remain in your account"
$flash->keep(); // keep messages set in the previous request so they will be available in the next request