PHP code example of gigafoxweb / notifier

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

    

gigafoxweb / notifier example snippets


$notification = new Notification('message', ['status' => 1]);

$memoryStorage = new Memory();
$memoryStorage->setNotification($notification);

$outputHandler = new OutputHandler();

Notifier::instance()->setStorage('memory', $memoryStorage);
Notifier::instance()->setHandler('output', $outputHandler);

$filter = new RequireParam(['some-

$filtrator = new Filtrator();
$filtrator->addFilter($filter);
Notifier::instance()->getHandler('output')->setFiltrator($filtrator);



use GigaFoxWeb\Notifier\Notifier;
use GigaFoxWeb\Notifier\notification\storages\Memory;
use GigaFoxWeb\Notifier\notification\storages\Session;
use GigaFoxWeb\Notifier\Notification;
use GigaFoxWeb\Notifier\notification\handlers\OutputHandler;
use GigaFoxWeb\Notifier\notification\Filtrator;
use GigaFoxWeb\Notifier\notification\filters\RequireParam;

session_start();

//setting notification storages
Notifier::instance()->setStorage('memory', new Memory());
Notifier::instance()->setStorage('session', new Session('GFW_notifications'));

//add notification into memory storage
Notifier::instance()->getStorage('memory')->setNotification(
    'hello',
    new Notification('Hello man!', ['->setFiltrator($filtrator);

//setting handler
Notifier::instance()->setHandler('output', $outputHandler);