PHP code example of vestin / hook

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

    

vestin / hook example snippets



use Vestin\Hook\Hook;

Hook::on('init', function(){ echo 'hello'; });
Hook::on('done', 'App\DoneTarget');
/*
 * other code you need
*/
Hook::call('init'); // see 'hello';
Hook::call('done'); // see 'bye';
DoneTarget
namespace App;
use Vestin\Hook\Target;
class DoneTarget implement Target{
    public function exec(){
        echo 'bye';
    }
}