定制 web-fu/proxy 二次开发

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

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

web-fu/proxy

最新稳定版本:v1.1.0

Composer 安装命令:

composer require web-fu/proxy

包简介

Library that allows to access array and object and proxy them

README 文档

README

Latest Stable Version PHP Version Require Test status Static analysis status Code style status

A library that allows to create proxies for array and objects

This library allows to create proxies for arrays and objects.

This is a spin-off of the PHP Dot Notation library.

Installation

composer require web-fu/proxy

Create a Proxy

$element = [
    'foo' => 'bar',
    'zod' => [
        'baz' => 'qux',
    ],
];

$proxy = new Proxy($element);

Getting and setting values

echo $proxy->get('foo'); //bar
$proxy->set('foo', 'baz');
echo $element['foo']; //baz

Checking keys

echo $proxy->has('foo'); //true
echo $proxy->isInitialised('foo'); //true
echo $proxy->dynamicKeysAllowed(); //true;

Creating and destroying keys

$proxy->create('rol', 'foo');
echo $element['rol']; //foo

$proxy->unset('zod');
var_dump($element); //['foo' => 'bar']

Getting a proxy for a key

$proxy->getProxy('zod')->set('baz', 'qux');
echo $element['zod']['baz']; //qux

See /examples folder for full examples

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-10-10