定制 pangolinkeys/php-binders 二次开发

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

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

pangolinkeys/php-binders

Composer 安装命令:

composer require pangolinkeys/php-binders

包简介

A repository to simplifiy combining arrays.

README 文档

README

A php repository to simplify combining arrays.

Usage

Add Bindable as a trait on the target classes.

use Bindable;

Implement the getKeys() method so the bind method knows how the array is keyed.

public function getKeys()
{        
    return array_keys($this->data);
} 

Create a get method suffixed by the name of the target attribute which is passed a singular key from the getKeys() method and returns a reference to the desired position in the array.

public function &getAge($person)
{
    return $this->data[ $person ]['Age'];
}

Finally, call bind and pass through the second object and the key which the bind should occur on.

$people->bind($preference, 'Age');

These methods should be implemented appropriately in both classes.

Example

A working example of this can be found in the /example directory.

统计信息

  • 总下载量: 18
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-12-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固