vestin/hook

php hook library

1.0 2017-04-07 08:05 UTC

This package is auto-updated.

Last update: 2024-10-21 22:58:53 UTC


README

Hook library inspired by

Installation

composer require vestin/hook

Example

namespace App;
use Vestin\Hook\Target;
class DoneTarget implement Target{
    public function exec(){
        echo 'bye';
    }
}
require 'vendor/autoload.php';
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';

License

MIT