/hooks

PHP Hooks System

Primary LanguagePHPMIT LicenseMIT

hooks

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");