PHP code example of sliver / flash-format

1. Go to this page and download the library: Download sliver/flash-format 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/ */

    

sliver / flash-format example snippets


array{
  title: string,
  description: ?string,
  level: ?string
}

use Sliver\Format\FlashMessage;

$simple = new FlashMessage('This is a flash message');

$structured = new FlashMessage([
  'title' => 'Approved!',
  'description' => 'Your submission has been approved.',
  'level' => 'success',
]);

use Sliver\Format\FlashMessage;

$message = new FlashMessage('I can be an array');

print_r($message->toArray());
// Array
// (
//     [title] => I can be an array
//     [description] => 
//     [level] => 
// )