botnyx/simple-object 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

botnyx/simple-object

Composer 安装命令:

composer require botnyx/simple-object

包简介

simple-object .

README 文档

README

SimpleObject allows you to create simple objects with minimal (yet sufficient) variable checking.

A simpleObject can be created by passing an array, object or json to the constructor.

Handy for creating custom data objects which require specific values - or have default values.

the following types are available to validate the input of the property.

string
int
bool
float
array
object

url
domain
tld
email
countrycode
languagecode
date
lowercase
uppercase
phone
alpha
nowhitespace
ip

Usage:

Create your own custom object.

class myObject extends Botnyx\SimpleObject {
	function objectProperties(){
		return array(
			"someVar1"=>	array( "type"=>"string", "required"=>true, "defval"=>"defaultVal"  ),
			"someVar2"=>	array( "type"=>"string", "required"=>false, "defval"=>""  )
		);
	}
	
	
}

Fill the custom object

$MyObject = new myObject( [array/object/json]);

Output/access the object

print_r($MyObject);

Output as Array

print_r($MyObject->asArray());

Output as Json

print_r($MyObject->asJson());

Once a property is set, it cannot be altered.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2019-04-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固