定制 slaxweb/getset 二次开发

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

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

slaxweb/getset

最新稳定版本:0.1.0

Composer 安装命令:

composer require slaxweb/getset

包简介

Getter and Setter traits for SlaxWeb Framework

README 文档

README

GetSet component provides the MagicGet and MagicSet traits that can be used to simplify and unify implementation of magic getter and setter.

Installation

Installation can be done through composer, just add slaxweb/getset package to your composer.json file:

{
    "require": {
        "slaxweb/getset": "0.1.*@dev"
    }
}

Usage

Usage of MagicGet and MagicSet traits is pretty simple and straightforward, you just need to use them in your class, and writing and reading of your otherwise inaccessible properties is available. Both the MagicGet and MagicSet traits will prepend an underscore (_) to the name of the requested property. If you wish to alter or disable the prepend, then your class that uses those traits must define the _getSetPrepend property with the value you wish to prepend to the requested properties.

If the requested property does not exist, then both traits will throw the \SlaxWeb\Exception\UnknownPropertyException exception.

Example usage:

<?php

class Foo
{
    use SlaxWeb\GetSet\MagicGet;
    use SlaxWeb\GetSet\MagicSet;

    protected $__bar = "";
    protected $_getSetPrepend = "__";
}

$foo = new Foo;

$foo->bar = "baz";
echo $foo->bar;

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-03-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固