Download the PHP package seanhepps/hooks without Composer
On this page you can find all versions of the php package seanhepps/hooks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download seanhepps/hooks
More information about seanhepps/hooks
Files in seanhepps/hooks
Download seanhepps/hooks
More information about seanhepps/hooks
Files in seanhepps/hooks
Vendor seanhepps
Package hooks
Short Description 类似WordPress的钩子机制
License MIT
Homepage https://github.com/seanhepps/hooks
Package hooks
Short Description 类似WordPress的钩子机制
License MIT
Homepage https://github.com/seanhepps/hooks
Please rate this library. Is it a good library?
Informations about the package hooks
hooks
类似WordPress的钩子机制,单独的类包,可直接用于laravel、thinkphp等框架
laravel添加服务提供者
\seanhepps\hooks\HookServiceProvider::class
添加别名
'Hook' => \seanhepps\hooks\Facades\Hook::class
添加钩子
Hook::getAction()->register($name, $class, 20)
保存到文件
Hook::getAction()->save()
如果想要更换缓存文件保存位置,可以修改Base类构造函数中的保存路径
监听
Hook::action($hookName, $args)
使用过滤器
使用过滤器和使用action钩子用法一模一样,只需要把上面getAction
替换成getFilter
就可以了
过滤器监听
$result = Hook::filter($hookName, $args)
All versions of hooks with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.0
The package seanhepps/hooks contains the following files
Loading the files please wait ....