PHP code example of dframe / messages
1. Go to this page and download the library: Download dframe/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/ */
dframe / messages example snippets
$driver = new \Dframe\Component\Session\Session('sessionName');
/**
* $driver Can be any class implements interface \Psr\SimpleCache\CacheInterface
*/
$messages = new \Dframe\Component\Messages\Messages($driver);
$messages->add('info', 'String Information.'); // types ['help', 'info', 'warning', 'error', 'success']
$messages->hasMessages('info'); // Check to see if there are any ($type) messages queued.
$messages->hasErrors(); // true There ARE error messages false There are NOT any error messages
$messages->display('all'); // Return true/false