50 lines
1.3 KiB
PHP
Raw Normal View History

2021-03-14 07:42:01 +08:00
<?php
// +----------------------------------------------------------------------
// | Catch-CMS Design On 2020
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catcher\library\form;
2021-03-29 19:51:41 +08:00
class FormOptions
2021-03-14 07:42:01 +08:00
{
2021-03-29 19:51:41 +08:00
protected $options = [];
2021-03-14 07:42:01 +08:00
/**
2021-03-29 19:51:41 +08:00
* 增加 option
2021-03-14 07:42:01 +08:00
*
2021-03-29 19:51:41 +08:00
* @time 2021年03月24日
* @param $label
* @param $value
* @return $this
2021-03-14 07:42:01 +08:00
*/
2021-03-29 19:51:41 +08:00
public function add($label, $value): FormOptions
2021-03-14 07:42:01 +08:00
{
2021-03-29 19:51:41 +08:00
$this->options[] = [
'value' => $value,
'label' => $label,
];
2021-03-14 07:42:01 +08:00
2021-03-29 19:51:41 +08:00
return $this;
}
2021-03-14 07:42:01 +08:00
2021-03-29 19:51:41 +08:00
/**
* 获取
*
* @time 2021年03月24日
* @return array
*/
public function render()
{
return $this->options;
2021-03-14 07:42:01 +08:00
}
}