action = $acton; return $this; } public function method($method) { $this->method = $method; return $this; } public function formId($formId) { $this->formId = $formId; return $this; } public function enctype($enctype ="multipart/form-data") { $this->enctype = $enctype; return $this; } public function id($id) { $this->fields[$this->name] = array_merge($this->fields[$this->name], [ 'id' => sprintf('id="%s"', $id), ]); return $this; } public function class($class='', $labelClass = '', $inlineClass = '') { $this->fields[$this->name] = array_merge($this->fields[$this->name], [ 'class' => $class, 'labelClass' => $labelClass, 'inlineClass' => $inlineClass, ]); return $this; } public function options(array $options) { $this->fields[$this->name] = array_merge($this->fields[$this->name], [ 'options' => $options, ]); return $this; } public function default($value) { $this->fields[$this->name] = array_merge($this->fields[$this->name], [ 'default' => $value, ]); return $this; } public function disabled() { $this->fields[$this->name] = array_merge($this->fields[$this->name], [ 'disabled' => '', ]); return $this; } public function placeholder($content) { $this->fields[$this->name] = array_merge($this->fields[$this->name], [ 'placeholder' => 'placeholder='.$content, ]); return $this; } public function readonly() { $this->fields[$this->name] = array_merge($this->fields[$this->name], [ 'readonly' => 'readonly', ]); return $this; } public function render() { $form = sprintf('
'; } public function append($append) { $this->fields[$this->name] = array_merge($this->fields[$this->name], [ 'append' => $append, ]); return $this; } public function __call($method, $arguments) { // TODO: Implement __call() method. $this->name = $arguments[0] ?? ''; $label = $arguments[1] ?? ''; $this->fields[$this->name] = [ 'name' => $this->name, 'type' => $method, 'label' => $label, 'inline' => false, ]; return $this; } protected function inline() { $this->fields[] = array_merge($this->fields, [ 'inline' => true, ]); return $this; } private function baseField() { return '