承接 cubicmushroom/options-trait 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

cubicmushroom/options-trait

最新稳定版本:1.0.2

Composer 安装命令:

composer require cubicmushroom/options-trait

包简介

Trait to make it easy to add options arrays to object classes

README 文档

README

Build Status

Options Trait

This trait is used to provide basic options setting, getting, checking, and merging with defaults

Properties

The trait add the following properties to the class...

$options

An array to the stroe the array of options in.

Methods

The trait adds the following methods to the class...

hasOption

Returns: boolean

Checks if an option is set or not

getOption

Returns: mixed

Gets a requested option.

If a second arguments is passed, will return this as the default if the option is not set. If not passed, null is returned.

setOption

Return: $this

Sets an option value

setOptions

Return: $this

Sets the options to the values given.

An optional second parameter allows for default values to be passed for options not included in the $options array.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-23