PHP code example of phpvv / notice

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

    

phpvv / notice example snippets


// bootstrap.php

\VV\Notice::factory()->config()
    ->addAllNoticer(new class implements \VV\Notice\AllNoticer {
        public function log(\VV\Notice $notice){
         // TODO: Implement log() method.
        }
        public function sendMail(\VV\Notice $notice,string $subject,string $message) : void{
         // TODO: Implement sendMail() method.
        }
        public function sendSms(\VV\Notice $notice) : void{
         // TODO: Implement sendSms() method.
        }
        public function syslog(\VV\Notice $notice) : void{
         // TODO: Implement syslog() method.
        }
    })
    //->setSmsRepeatTimeout(3600)
    //->setCache(new \VV\Cache\Local\FileCache(\VV\Utils\Fs::tmpDir('notice-timeout-lock')))
    ;

use VV\Notice;

Notice::info('Some information'/*, code: 300*/)->mail();
Notice::warning('Some warning'/*, code: 200*/)
    //->log()->mail()  // same as below
    ->logMail();
Notice::error('Some error'/*, code: 100*/)
    //->log()->mail()->syslog()->sms() // same as below
    ->all();