PHP code example of coreplex / notifier

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

    

coreplex / notifier example snippets


"coreplex/notifier": "~0.2"

'providers' => array(

  Coreplex\Core\CoreServiceProvider::class,
  Coreplex\Notifier\NotifierServiceProvider::class,

);

'aliases' => array(

  Notifier'  => Coreplex\Notifier\Facades\Notifier::class,
  
);

$parser = new Coreplex\Notifier\Parser();

$notifier = new Coreplex\Notifier\Notifier($parser, $session, $config);

Notifier::render();

public function __construct(\Coreplex\Notifier\Contracts\Notifier $notifier)
{
    $this->notifier = $notifier;
}

$notifier->notify('success');

$notifier->success();

$notifier->notify('success', [
    'title' => 'Success',
]);

$notifier->success([
   'title' => 'Success',
]);

$notifier->success(['title' => 'Foo']);
$notifier->error(['title' => 'Bar']);

 echo $notifier->render(); 

'notifiers' => [

    'alertify' => [
    
        'template' => 'alertify.{{ level }}("<strong>{{ title }}</strong><br>{{ message }}");',
        'css' => [],
        'scripts' => [],
        'levels' => [
            'info' => 'log',
            'success' => 'success',
            'error' => 'error',
        ],
    
    ],

],

'template' => 'notifier.{{ level }}("Hello World!");'

'template' => 'notifier.{{ level }}("{{ body }}");'

'template' => 'notifier.{{ level }}("[if:icon] {{ icon }} [endif] {{ body }}");

'levels' => [
    'info' => 'log',
    'success' => 'success',
    'error' => 'error',
],

'levels' => [
    'info' => 'log',
    'success' => 'success',
    'error' => 'error',
    'custom' => 'fooBar',
],

$notifier->notify('custom');

$notifier->custom();

'css' => [
    'path/to/styles.css'
],
'scripts' => [
    'path/to/scripts.js'
],

<head>
     echo $notifier->styles();