'string', 'vertical' => 'boolean' ]; /** * 使用按钮样式 * @return $this */ public function button() { $this->props['type'] = 'button'; return $this; } protected function getValidateHandler() { return Validate::str(); } /** * @return array */ public function build() { $options = []; foreach ($this->options as $option) { if ($option instanceof Option) $options[] = $option->build(); } return [ 'type' => $this->name, 'field' => $this->field, 'title' => $this->title, 'value' => $this->value, 'props' => (object)$this->props, 'options' => $options, 'validate' => $this->validate, 'col'=>$this->col ]; } }