pentagonal/hookable
Composer 安装命令:
composer require pentagonal/hookable
包简介
Hook able Library like a WordPress uses
README 文档
README
Hook able Library like a WordPress uses
Usage
$hook = new \Pentagonal\Hookable\Hookable(); /** * Add Hook into functions example */ function thIsIsOnHookReturn() { global $hooks; /** * .... run the code */ $the_result = array('array_result'); // the returning result return $hook->apply('callback_name', $the_result); } /** * in here * Calling thIsIsOnHookReturn() * will be returning array */ var_dump(thIsIsOnHookReturn()); /** * add filter / action on determined callback */ $hook->add( 'callback_name', // the callback function ($returning_old_result) { $new_result = print_r($returning_result, true); return $new_result; }, 10, // priority 1 // arguments accepted ); /** * in here * Calling thIsIsOnHookReturn() * will be returning string of array printed */ var_dump(thIsIsOnHookReturn());
Install
{
"require": {
"pentagonal/hookable": "^1"
}
}
统计信息
- 总下载量: 134
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 13
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2016-06-03