PHP code example of webware / webware-message

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

    

webware / webware-message example snippets


// config/pipeline.php
$app->pipe(Mezzio\Session\SessionMiddleware::class);
$app->pipe(Webware\Message\Http\Middleware\MessageMiddleware::class);

use Webware\Message\MessageLevel;
use Webware\Message\SystemMessengerInterface;

/** @var SystemMessengerInterface $messenger */
$messenger = $request->getAttribute(SystemMessengerInterface::class);

$messenger->success('Saved!');          // current request only
$messenger->warning('Check this', 1);   // current + next request
$messenger->info('Heads up', 1, false); // next request only

<?= $this->systemMessenger()