PHP code example of romanato / php-flashingo-messages
1. Go to this page and download the library: Download romanato/php-flashingo-messages 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/ */
romanato / php-flashingo-messages example snippets
// Create new instance
$flashingo = new Romanato\FlashingoMessage\FlashingoMessage;
// Set flash message
$flashingo->set('This is a flash message.');
// Display messages
$flashingo->displayAll();
// Set type using set method
$flashingo->set('This is a flash error message.', 'error');
// Set type using shorter method
$flashingo->setWarning('This is an warning but shorter.');
// Set options
$flashingo->set('I am awesome!', 'warning', [
'name' => 'awesomeId',
'class' => 'specialClass'
]);
$flashingo->setSuccess('I am awesome!', [
'name' => 'awesomeId',
'class' => 'specialClass'
]);
// Display message by name
$flashingo->display('awesomeId');