定制 pentagonal/hookable 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pentagonal/hookable

Composer 安装命令:

composer require pentagonal/hookable

包简介

Hook able Library like a WordPress uses

README 文档

README

Hook able Library like a WordPress uses

Build Status Latest Stable Version License Total Downloads

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

GitHub 信息

  • Stars: 13
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2016-06-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固