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
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
其他信息
- 授权协议: MIT
- 更新时间: 2015-02-23