daniellucia / hooks
PHP Hooks System
v0.2.4
2018-03-20 14:22 UTC
Requires (Dev)
- phpunit/phpunit: ~4.5
This package is not auto-updated.
Last update: 2024-09-29 05:21:07 UTC
README
PHP Hooks System
Installing
Install using Composer.
$ composer require daniellucia/hooks
Usage Action
$hooks = new daniellucia\Hooks\Manager; $hooks->action->add("header", function() { echo "Hello!"; }); $hooks->action->run("header");
Usage Filter
$hooks = new daniellucia\Hooks\Manager; $hooks->filter->add("header", function($value) { return $value . " World!"; }); echo $hooks->filter->apply("header", "Hello");