PHP 插件系统

v0.2.4 2018-03-20 14:22 UTC

This package is not auto-updated.

Last update: 2024-09-29 05:21:07 UTC


README

PHP 插件系统

安装

使用 Composer 安装。

$ composer require daniellucia/hooks

使用动作

$hooks = new daniellucia\Hooks\Manager;

$hooks->action->add("header", function() {
	echo "Hello!";
});

$hooks->action->run("header");

使用过滤器

$hooks = new daniellucia\Hooks\Manager;

$hooks->filter->add("header", function($value) {
	return $value . " World!";
});

echo $hooks->filter->apply("header", "Hello");