|
@@ 38-47 (lines=10) @@
|
| 35 |
|
return HTML::error($this->errors->first($name)); |
| 36 |
|
} |
| 37 |
|
|
| 38 |
|
public function text(string $name, bool $required = false, string $locale = '') : string |
| 39 |
|
{ |
| 40 |
|
$fieldName = $this->fieldName($name, $locale); |
| 41 |
|
|
| 42 |
|
return $this->group([ |
| 43 |
|
$this->label($name, $required), |
| 44 |
|
Form::text($fieldName, Form::useInitialValue($this->model, $name, $locale)), |
| 45 |
|
$this->error($fieldName, $this->errors), |
| 46 |
|
]); |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
public function textarea(string $name, bool $required = false, string $locale = '') : string |
| 50 |
|
{ |
|
@@ 49-58 (lines=10) @@
|
| 46 |
|
]); |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
public function textarea(string $name, bool $required = false, string $locale = '') : string |
| 50 |
|
{ |
| 51 |
|
$fieldName = $this->fieldName($name, $locale); |
| 52 |
|
|
| 53 |
|
return $this->group([ |
| 54 |
|
$this->label($name, $required), |
| 55 |
|
Form::textarea($fieldName, Form::useInitialValue($this->model, $name, $locale), ['data-autosize']), |
| 56 |
|
$this->error($fieldName, $this->errors), |
| 57 |
|
]); |
| 58 |
|
} |
| 59 |
|
|
| 60 |
|
public function redactor(string $name, bool $required = false, string $locale = '') : string |
| 61 |
|
{ |
|
@@ 92-101 (lines=10) @@
|
| 89 |
|
return $this->group([el('label.-checkbox', $contents)]); |
| 90 |
|
} |
| 91 |
|
|
| 92 |
|
public function date(string $name, bool $required = false, string $locale = '') : string |
| 93 |
|
{ |
| 94 |
|
$fieldName = $this->fieldName($name, $locale); |
| 95 |
|
|
| 96 |
|
return $this->group([ |
| 97 |
|
$this->label($name, $required), |
| 98 |
|
Form::datePicker($fieldName, Form::useInitialValue($this->model, $name, $locale)), |
| 99 |
|
$this->error($fieldName, $this->errors), |
| 100 |
|
]); |
| 101 |
|
} |
| 102 |
|
|
| 103 |
|
public function select(string $name, $options, string $locale = '') : string |
| 104 |
|
{ |
|
@@ 103-117 (lines=15) @@
|
| 100 |
|
]); |
| 101 |
|
} |
| 102 |
|
|
| 103 |
|
public function select(string $name, $options, string $locale = '') : string |
| 104 |
|
{ |
| 105 |
|
$fieldName = $this->fieldName($name, $locale); |
| 106 |
|
|
| 107 |
|
return $this->group([ |
| 108 |
|
$this->label($name, true), |
| 109 |
|
Form::select( |
| 110 |
|
$fieldName, |
| 111 |
|
$options, |
| 112 |
|
Form::useInitialValue($this->model, $name, $locale), |
| 113 |
|
['data-select' => 'select'] |
| 114 |
|
), |
| 115 |
|
$this->error($fieldName, $this->errors), |
| 116 |
|
]); |
| 117 |
|
} |
| 118 |
|
|
| 119 |
|
public function searchableSelect(string $name, $options, string $locale = '') : string |
| 120 |
|
{ |
|
@@ 119-133 (lines=15) @@
|
| 116 |
|
]); |
| 117 |
|
} |
| 118 |
|
|
| 119 |
|
public function searchableSelect(string $name, $options, string $locale = '') : string |
| 120 |
|
{ |
| 121 |
|
$fieldName = $this->fieldName($name, $locale); |
| 122 |
|
|
| 123 |
|
return $this->group([ |
| 124 |
|
$this->label($name), |
| 125 |
|
Form::select( |
| 126 |
|
$fieldName, |
| 127 |
|
$options, |
| 128 |
|
Form::useInitialValue($this->model, $name, $locale), |
| 129 |
|
['data-select' => 'search'] |
| 130 |
|
), |
| 131 |
|
$this->error($fieldName, $this->errors), |
| 132 |
|
]); |
| 133 |
|
} |
| 134 |
|
|
| 135 |
|
public function tags(string $type) : string |
| 136 |
|
{ |