|
|
@@ -32,61 +32,61 @@ use Symfony\Component\HttpFoundation\Response;
|
|
|
/**
|
|
|
* Class Form.
|
|
|
*
|
|
|
- * @method Field\Text text($column, $label = '')
|
|
|
- * @method Field\Checkbox checkbox($column, $label = '')
|
|
|
- * @method Field\Radio radio($column, $label = '')
|
|
|
- * @method Field\Select select($column, $label = '')
|
|
|
- * @method Field\MultipleSelect multipleSelect($column, $label = '')
|
|
|
- * @method Field\Textarea textarea($column, $label = '')
|
|
|
- * @method Field\Hidden hidden($column, $label = '')
|
|
|
- * @method Field\Id id($column, $label = '')
|
|
|
- * @method Field\Ip ip($column, $label = '')
|
|
|
- * @method Field\Url url($column, $label = '')
|
|
|
- * @method Field\Email email($column, $label = '')
|
|
|
- * @method Field\Mobile mobile($column, $label = '')
|
|
|
- * @method Field\Slider slider($column, $label = '')
|
|
|
- * @method Field\Map map($latitude, $longitude, $label = '')
|
|
|
- * @method Field\Editor editor($column, $label = '')
|
|
|
- * @method Field\Date date($column, $label = '')
|
|
|
- * @method Field\Datetime datetime($column, $label = '')
|
|
|
- * @method Field\Time time($column, $label = '')
|
|
|
- * @method Field\Year year($column, $label = '')
|
|
|
- * @method Field\Month month($column, $label = '')
|
|
|
- * @method Field\DateRange dateRange($start, $end, $label = '')
|
|
|
- * @method Field\DateTimeRange datetimeRange($start, $end, $label = '')
|
|
|
- * @method Field\TimeRange timeRange($start, $end, $label = '')
|
|
|
- * @method Field\Number number($column, $label = '')
|
|
|
- * @method Field\Currency currency($column, $label = '')
|
|
|
- * @method Field\SwitchField switch($column, $label = '')
|
|
|
- * @method Field\Display display($column, $label = '')
|
|
|
- * @method Field\Rate rate($column, $label = '')
|
|
|
- * @method Field\Divide divider(string $title = null)
|
|
|
- * @method Field\Password password($column, $label = '')
|
|
|
- * @method Field\Decimal decimal($column, $label = '')
|
|
|
- * @method Field\Html html($html, $label = '')
|
|
|
- * @method Field\Tags tags($column, $label = '')
|
|
|
- * @method Field\Icon icon($column, $label = '')
|
|
|
- * @method Field\Embeds embeds($column, $label = '', Closure $callback = null)
|
|
|
- * @method Field\Captcha captcha()
|
|
|
- * @method Field\Listbox listbox($column, $label = '')
|
|
|
- * @method Field\File file($column, $label = '')
|
|
|
- * @method Field\Image image($column, $label = '')
|
|
|
- * @method Field\MultipleFile multipleFile($column, $label = '')
|
|
|
- * @method Field\MultipleImage multipleImage($column, $label = '')
|
|
|
- * @method Field\HasMany hasMany($column, $labelOrCallback, $callback = null)
|
|
|
- * @method Field\Tree tree($column, $label = '')
|
|
|
- * @method Field\Table table($column, $labelOrCallback, $callback = null)
|
|
|
- * @method Field\ListField list($column, $label = '')
|
|
|
- * @method Field\Timezone timezone($column, $label = '')
|
|
|
- * @method Field\KeyValue keyValue($column, $label = '')
|
|
|
- * @method Field\Tel tel($column, $label = '')
|
|
|
- * @method Field\Markdown markdown($column, $label = '')
|
|
|
- * @method Field\Range range($start, $end, $label = '')
|
|
|
- * @method Field\Color color($column, $label = '')
|
|
|
- * @method Field\ArrayField array($column, $labelOrCallback, $callback = null)
|
|
|
- * @method Field\SelectTable selectTable($column, $label = '')
|
|
|
- * @method Field\MultipleSelectTable multipleSelectTable($column, $label = '')
|
|
|
- * @method Field\Button button(string $html = null)
|
|
|
+ * @method Field\Text text($column, $label = '')
|
|
|
+ * @method Field\Checkbox checkbox($column, $label = '')
|
|
|
+ * @method Field\Radio radio($column, $label = '')
|
|
|
+ * @method Field\Select select($column, $label = '')
|
|
|
+ * @method Field\MultipleSelect multipleSelect($column, $label = '')
|
|
|
+ * @method Field\Textarea textarea($column, $label = '')
|
|
|
+ * @method Field\Hidden hidden($column, $label = '')
|
|
|
+ * @method Field\Id id($column, $label = '')
|
|
|
+ * @method Field\Ip ip($column, $label = '')
|
|
|
+ * @method Field\Url url($column, $label = '')
|
|
|
+ * @method Field\Email email($column, $label = '')
|
|
|
+ * @method Field\Mobile mobile($column, $label = '')
|
|
|
+ * @method Field\Slider slider($column, $label = '')
|
|
|
+ * @method Field\Map map($latitude, $longitude, $label = '')
|
|
|
+ * @method Field\Editor editor($column, $label = '')
|
|
|
+ * @method Field\Date date($column, $label = '')
|
|
|
+ * @method Field\Datetime datetime($column, $label = '')
|
|
|
+ * @method Field\Time time($column, $label = '')
|
|
|
+ * @method Field\Year year($column, $label = '')
|
|
|
+ * @method Field\Month month($column, $label = '')
|
|
|
+ * @method Field\DateRange dateRange($start, $end, $label = '')
|
|
|
+ * @method Field\DateTimeRange datetimeRange($start, $end, $label = '')
|
|
|
+ * @method Field\TimeRange timeRange($start, $end, $label = '')
|
|
|
+ * @method Field\Number number($column, $label = '')
|
|
|
+ * @method Field\Currency currency($column, $label = '')
|
|
|
+ * @method Field\SwitchField switch($column, $label = '')
|
|
|
+ * @method Field\Display display($column, $label = '')
|
|
|
+ * @method Field\Rate rate($column, $label = '')
|
|
|
+ * @method Field\Divide divider(string $title = null)
|
|
|
+ * @method Field\Password password($column, $label = '')
|
|
|
+ * @method Field\Decimal decimal($column, $label = '')
|
|
|
+ * @method Field\Html html($html, $label = '')
|
|
|
+ * @method Field\Tags tags($column, $label = '')
|
|
|
+ * @method Field\Icon icon($column, $label = '')
|
|
|
+ * @method Field\Embeds embeds($column, $label = '', Closure $callback = null)
|
|
|
+ * @method Field\Captcha captcha()
|
|
|
+ * @method Field\Listbox listbox($column, $label = '')
|
|
|
+ * @method Field\File file($column, $label = '')
|
|
|
+ * @method Field\Image image($column, $label = '')
|
|
|
+ * @method Field\MultipleFile multipleFile($column, $label = '')
|
|
|
+ * @method Field\MultipleImage multipleImage($column, $label = '')
|
|
|
+ * @method Field\HasMany hasMany($column, $labelOrCallback, $callback = null)
|
|
|
+ * @method Field\Tree tree($column, $label = '')
|
|
|
+ * @method Field\Table table($column, $labelOrCallback, $callback = null)
|
|
|
+ * @method Field\ListField list($column, $label = '')
|
|
|
+ * @method Field\Timezone timezone($column, $label = '')
|
|
|
+ * @method Field\KeyValue keyValue($column, $label = '')
|
|
|
+ * @method Field\Tel tel($column, $label = '')
|
|
|
+ * @method Field\Markdown markdown($column, $label = '')
|
|
|
+ * @method Field\Range range($start, $end, $label = '')
|
|
|
+ * @method Field\Color color($column, $label = '')
|
|
|
+ * @method Field\ArrayField array($column, $labelOrCallback, $callback = null)
|
|
|
+ * @method Field\SelectTable selectTable($column, $label = '')
|
|
|
+ * @method Field\MultipleSelectTable multipleSelectTable($column, $label = '')
|
|
|
+ * @method Field\Button button(string $html = null)
|
|
|
*/
|
|
|
class Form implements Renderable
|
|
|
{
|
|
|
@@ -279,9 +279,9 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Create a new form instance.
|
|
|
*
|
|
|
- * @param Repository|Model|\Illuminate\Database\Eloquent\Builder|string $model
|
|
|
- * @param \Closure $callback
|
|
|
- * @param Request $request
|
|
|
+ * @param Repository|Model|\Illuminate\Database\Eloquent\Builder|string $model
|
|
|
+ * @param \Closure $callback
|
|
|
+ * @param Request $request
|
|
|
*/
|
|
|
public function __construct($repository = null, ?Closure $callback = null, Request $request = null)
|
|
|
{
|
|
|
@@ -299,8 +299,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Create a form instance.
|
|
|
*
|
|
|
- * @param mixed ...$params
|
|
|
- *
|
|
|
+ * @param mixed ...$params
|
|
|
* @return $this
|
|
|
*/
|
|
|
public static function make(...$params)
|
|
|
@@ -309,8 +308,7 @@ class Form implements Renderable
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param Field $field
|
|
|
- *
|
|
|
+ * @param Field $field
|
|
|
* @return $this
|
|
|
*/
|
|
|
public function pushField(Field $field)
|
|
|
@@ -334,8 +332,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Get specify field.
|
|
|
*
|
|
|
- * @param string|null $name
|
|
|
- *
|
|
|
+ * @param string|null $name
|
|
|
* @return Field|Collection|Field[]|null
|
|
|
*/
|
|
|
public function field($name = null)
|
|
|
@@ -353,7 +350,6 @@ class Form implements Renderable
|
|
|
|
|
|
/**
|
|
|
* @param $column
|
|
|
- *
|
|
|
* @return $this
|
|
|
*/
|
|
|
public function removeField($column)
|
|
|
@@ -364,9 +360,8 @@ class Form implements Renderable
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param string $title
|
|
|
- * @param string $content
|
|
|
- *
|
|
|
+ * @param string $title
|
|
|
+ * @param string $content
|
|
|
* @return $this
|
|
|
*/
|
|
|
public function confirm(?string $title = null, ?string $content = null)
|
|
|
@@ -401,8 +396,7 @@ class Form implements Renderable
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param Fluent|array|\Illuminate\Database\Eloquent\Model $model
|
|
|
- *
|
|
|
+ * @param Fluent|array|\Illuminate\Database\Eloquent\Model $model
|
|
|
* @return Fluent|\Illuminate\Database\Eloquent\Model|void
|
|
|
*/
|
|
|
public function model($model = null)
|
|
|
@@ -431,8 +425,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* 启用或禁用ajax表单提交.
|
|
|
*
|
|
|
- * @param bool $value
|
|
|
- *
|
|
|
+ * @param bool $value
|
|
|
* @return $this
|
|
|
*/
|
|
|
public function ajax(bool $value = true)
|
|
|
@@ -453,8 +446,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* 设置使用 Toastr 展示字段验证信息.
|
|
|
*
|
|
|
- * @param bool $value
|
|
|
- *
|
|
|
+ * @param bool $value
|
|
|
* @return $this
|
|
|
*/
|
|
|
public function validationErrorToastr(bool $value = true)
|
|
|
@@ -465,8 +457,7 @@ class Form implements Renderable
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param \Closure $closure
|
|
|
- *
|
|
|
+ * @param \Closure $closure
|
|
|
* @return $this;
|
|
|
*/
|
|
|
public function wrap(\Closure $closure)
|
|
|
@@ -512,7 +503,6 @@ class Form implements Renderable
|
|
|
* Generate a edit form.
|
|
|
*
|
|
|
* @param $id
|
|
|
- *
|
|
|
* @return $this
|
|
|
*/
|
|
|
public function edit($id)
|
|
|
@@ -528,9 +518,8 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Add a fieldset to form.
|
|
|
*
|
|
|
- * @param string $title
|
|
|
- * @param Closure $setCallback
|
|
|
- *
|
|
|
+ * @param string $title
|
|
|
+ * @param Closure $setCallback
|
|
|
* @return Field\Fieldset
|
|
|
*/
|
|
|
public function fieldset(string $title, Closure $setCallback)
|
|
|
@@ -550,7 +539,6 @@ class Form implements Renderable
|
|
|
* Destroy data entity and remove files.
|
|
|
*
|
|
|
* @param $id
|
|
|
- *
|
|
|
* @return mixed
|
|
|
*/
|
|
|
public function destroy($id)
|
|
|
@@ -604,8 +592,7 @@ class Form implements Renderable
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param \Throwable $e
|
|
|
- *
|
|
|
+ * @param \Throwable $e
|
|
|
* @return mixed
|
|
|
*/
|
|
|
protected function handleException(\Throwable $e)
|
|
|
@@ -616,9 +603,8 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Store a new record.
|
|
|
*
|
|
|
- * @param array|null $data
|
|
|
- * @param string|string $redirectTo
|
|
|
- *
|
|
|
+ * @param array|null $data
|
|
|
+ * @param string|string $redirectTo
|
|
|
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\Http\JsonResponse|Response
|
|
|
*/
|
|
|
public function store(?array $data = null, $redirectTo = null)
|
|
|
@@ -681,8 +667,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Before store.
|
|
|
*
|
|
|
- * @param array $data
|
|
|
- *
|
|
|
+ * @param array $data
|
|
|
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse|Response|void
|
|
|
*/
|
|
|
protected function beforeStore(array $data)
|
|
|
@@ -716,8 +701,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Prepare input data for insert or update.
|
|
|
*
|
|
|
- * @param array $data
|
|
|
- *
|
|
|
+ * @param array $data
|
|
|
* @return Response|null
|
|
|
*/
|
|
|
protected function prepare($data = [])
|
|
|
@@ -734,8 +718,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Remove ignored fields from input.
|
|
|
*
|
|
|
- * @param array $input
|
|
|
- *
|
|
|
+ * @param array $input
|
|
|
* @return array
|
|
|
*/
|
|
|
public function removeIgnoredFields($input)
|
|
|
@@ -748,8 +731,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Get or set data for insert or update.
|
|
|
*
|
|
|
- * @param array $updates
|
|
|
- *
|
|
|
+ * @param array $updates
|
|
|
* @return $this|array
|
|
|
*/
|
|
|
public function updates(array $updates = null)
|
|
|
@@ -766,9 +748,8 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Handle orderable update.
|
|
|
*
|
|
|
- * @param int $id
|
|
|
- * @param array $input
|
|
|
- *
|
|
|
+ * @param int $id
|
|
|
+ * @param array $input
|
|
|
* @return Response
|
|
|
*/
|
|
|
protected function handleOrderable(array $input = [])
|
|
|
@@ -794,9 +775,8 @@ class Form implements Renderable
|
|
|
* Handle update.
|
|
|
*
|
|
|
* @param $id
|
|
|
- * @param array|null $data
|
|
|
- * @param string|null $redirectTo
|
|
|
- *
|
|
|
+ * @param array|null $data
|
|
|
+ * @param string|null $redirectTo
|
|
|
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse||Response
|
|
|
*/
|
|
|
public function update(
|
|
|
@@ -861,8 +841,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Before update.
|
|
|
*
|
|
|
- * @param array $data
|
|
|
- *
|
|
|
+ * @param array $data
|
|
|
* @return Response|void
|
|
|
*/
|
|
|
protected function beforeUpdate($id, array &$data)
|
|
|
@@ -911,8 +890,7 @@ class Form implements Renderable
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param array $inputs
|
|
|
- *
|
|
|
+ * @param array $inputs
|
|
|
* @return array
|
|
|
*/
|
|
|
protected function handleHasManyValues(array $inputs)
|
|
|
@@ -941,7 +919,6 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* @param $key
|
|
|
* @param $redirectTo
|
|
|
- *
|
|
|
* @return string|null
|
|
|
*/
|
|
|
public function getRedirectUrl($key, $redirectTo = null)
|
|
|
@@ -977,8 +954,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Check if request is from editable.
|
|
|
*
|
|
|
- * @param array $input
|
|
|
- *
|
|
|
+ * @param array $input
|
|
|
* @return bool
|
|
|
*/
|
|
|
protected function isEditable(array $input = [])
|
|
|
@@ -989,8 +965,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Handle editable update.
|
|
|
*
|
|
|
- * @param array $input
|
|
|
- *
|
|
|
+ * @param array $input
|
|
|
* @return array
|
|
|
*/
|
|
|
protected function handleEditable(array $input = [])
|
|
|
@@ -1009,8 +984,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Prepare input data for update.
|
|
|
*
|
|
|
- * @param array $updates
|
|
|
- *
|
|
|
+ * @param array $updates
|
|
|
* @return array
|
|
|
*/
|
|
|
public function prepareUpdate(array $updates)
|
|
|
@@ -1046,7 +1020,6 @@ class Form implements Renderable
|
|
|
* Prepare input data for insert.
|
|
|
*
|
|
|
* @param $inserts
|
|
|
- *
|
|
|
* @return array
|
|
|
*/
|
|
|
public function prepareInsert($inserts)
|
|
|
@@ -1074,8 +1047,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Ignore fields to save.
|
|
|
*
|
|
|
- * @param string|array $fields
|
|
|
- *
|
|
|
+ * @param string|array $fields
|
|
|
* @return $this
|
|
|
*/
|
|
|
public function ignore($fields)
|
|
|
@@ -1089,7 +1061,6 @@ class Form implements Renderable
|
|
|
|
|
|
/**
|
|
|
* @param $keys
|
|
|
- *
|
|
|
* @return $this
|
|
|
*/
|
|
|
public function forgetIgnored($keys)
|
|
|
@@ -1138,9 +1109,8 @@ class Form implements Renderable
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param array $data
|
|
|
- * @param string|array $columns
|
|
|
- *
|
|
|
+ * @param array $data
|
|
|
+ * @param string|array $columns
|
|
|
* @return array|mixed
|
|
|
*/
|
|
|
protected function getDataByColumn($data, $columns)
|
|
|
@@ -1196,8 +1166,7 @@ class Form implements Renderable
|
|
|
*
|
|
|
* $form->if(true)->removeField('name');
|
|
|
*
|
|
|
- * @param bool|\Closure $condition
|
|
|
- *
|
|
|
+ * @param bool|\Closure $condition
|
|
|
* @return Condition
|
|
|
*/
|
|
|
public function if($condition)
|
|
|
@@ -1223,8 +1192,7 @@ class Form implements Renderable
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param array $data
|
|
|
- *
|
|
|
+ * @param array $data
|
|
|
* @return void
|
|
|
*/
|
|
|
public function fillFields(array $data)
|
|
|
@@ -1253,8 +1221,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Get validation messages.
|
|
|
*
|
|
|
- * @param array $input
|
|
|
- *
|
|
|
+ * @param array $input
|
|
|
* @return MessageBag|bool
|
|
|
*/
|
|
|
public function validationMessages($input)
|
|
|
@@ -1282,9 +1249,8 @@ class Form implements Renderable
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param string|array|MessageProvider $column
|
|
|
- * @param string|array $messages
|
|
|
- *
|
|
|
+ * @param string|array|MessageProvider $column
|
|
|
+ * @param string|array $messages
|
|
|
* @return $this
|
|
|
*/
|
|
|
public function responseValidationMessages($column, $messages = null)
|
|
|
@@ -1316,8 +1282,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Merge validation messages from input validators.
|
|
|
*
|
|
|
- * @param array $validators
|
|
|
- *
|
|
|
+ * @param array $validators
|
|
|
* @return MessageBag
|
|
|
*/
|
|
|
protected function mergeValidationMessages($validators)
|
|
|
@@ -1340,8 +1305,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Get or set action for form.
|
|
|
*
|
|
|
- * @param string|null $action
|
|
|
- *
|
|
|
+ * @param string|null $action
|
|
|
* @return $this|string
|
|
|
*/
|
|
|
public function action($action = null)
|
|
|
@@ -1358,9 +1322,8 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Set field and label width in current form.
|
|
|
*
|
|
|
- * @param int $fieldWidth
|
|
|
- * @param int $labelWidth
|
|
|
- *
|
|
|
+ * @param int $fieldWidth
|
|
|
+ * @param int $labelWidth
|
|
|
* @return $this
|
|
|
*/
|
|
|
public function width($fieldWidth = 8, $labelWidth = 2)
|
|
|
@@ -1378,8 +1341,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Set view for form.
|
|
|
*
|
|
|
- * @param string $view
|
|
|
- *
|
|
|
+ * @param string $view
|
|
|
* @return $this
|
|
|
*/
|
|
|
public function view($view)
|
|
|
@@ -1390,8 +1352,7 @@ class Form implements Renderable
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param array $vars
|
|
|
- *
|
|
|
+ * @param array $vars
|
|
|
* @return $this
|
|
|
*/
|
|
|
public function addVariables(array $vars)
|
|
|
@@ -1404,8 +1365,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Get or set title for form.
|
|
|
*
|
|
|
- * @param string $title
|
|
|
- *
|
|
|
+ * @param string $title
|
|
|
* @return $this
|
|
|
*/
|
|
|
public function title($title = null)
|
|
|
@@ -1418,8 +1378,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Tools setting for form.
|
|
|
*
|
|
|
- * @param Closure|string|AbstractTool|Renderable|Action|array $callback
|
|
|
- *
|
|
|
+ * @param Closure|string|AbstractTool|Renderable|Action|array $callback
|
|
|
* @return $this;
|
|
|
*/
|
|
|
public function tools($callback)
|
|
|
@@ -1442,8 +1401,7 @@ class Form implements Renderable
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param bool $disable
|
|
|
- *
|
|
|
+ * @param bool $disable
|
|
|
* @return $this
|
|
|
*/
|
|
|
public function disableHeader(bool $disable = true)
|
|
|
@@ -1454,8 +1412,7 @@ class Form implements Renderable
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param bool $disable
|
|
|
- *
|
|
|
+ * @param bool $disable
|
|
|
* @return $this
|
|
|
*/
|
|
|
public function disableFooter(bool $disable = true)
|
|
|
@@ -1600,8 +1557,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Footer setting for form.
|
|
|
*
|
|
|
- * @param Closure $callback
|
|
|
- *
|
|
|
+ * @param Closure $callback
|
|
|
* @return $this
|
|
|
*/
|
|
|
public function footer(Closure $callback)
|
|
|
@@ -1614,8 +1570,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Get current resource route url.
|
|
|
*
|
|
|
- * @param int $slice
|
|
|
- *
|
|
|
+ * @param int $slice
|
|
|
* @return string
|
|
|
*/
|
|
|
public function resource($slice = -2)
|
|
|
@@ -1634,8 +1589,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Set resource path.
|
|
|
*
|
|
|
- * @param string $resource
|
|
|
- *
|
|
|
+ * @param string $resource
|
|
|
* @return $this
|
|
|
*/
|
|
|
public function setResource(string $resource)
|
|
|
@@ -1664,9 +1618,8 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Get or set input data.
|
|
|
*
|
|
|
- * @param string|array $key
|
|
|
- * @param mixed $value
|
|
|
- *
|
|
|
+ * @param string|array $key
|
|
|
+ * @param mixed $value
|
|
|
* @return array|mixed
|
|
|
*/
|
|
|
public function input($key = null, $value = null)
|
|
|
@@ -1689,8 +1642,7 @@ class Form implements Renderable
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param string|array $keys
|
|
|
- *
|
|
|
+ * @param string|array $keys
|
|
|
* @return void
|
|
|
*/
|
|
|
public function deleteInput($keys)
|
|
|
@@ -1699,9 +1651,8 @@ class Form implements Renderable
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param int $width
|
|
|
- * @param Closure $callback
|
|
|
- *
|
|
|
+ * @param int $width
|
|
|
+ * @param Closure $callback
|
|
|
* @return $this
|
|
|
*/
|
|
|
public function block(int $width, \Closure $callback)
|
|
|
@@ -1715,9 +1666,8 @@ class Form implements Renderable
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param int|float $width
|
|
|
- * @param Closure $callback
|
|
|
- *
|
|
|
+ * @param int|float $width
|
|
|
+ * @param Closure $callback
|
|
|
* @return $this
|
|
|
*/
|
|
|
public function column($width, \Closure $callback)
|
|
|
@@ -1740,8 +1690,7 @@ class Form implements Renderable
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param Closure $callback
|
|
|
- *
|
|
|
+ * @param Closure $callback
|
|
|
* @return bool|void
|
|
|
*/
|
|
|
public function inDialog(\Closure $callback = null)
|
|
|
@@ -1758,8 +1707,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Create a dialog form.
|
|
|
*
|
|
|
- * @param string|null $title
|
|
|
- *
|
|
|
+ * @param string|null $title
|
|
|
* @return DialogForm
|
|
|
*/
|
|
|
public static function dialog(?string $title = null)
|
|
|
@@ -1770,9 +1718,8 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Register custom field.
|
|
|
*
|
|
|
- * @param string $abstract
|
|
|
- * @param string $class
|
|
|
- *
|
|
|
+ * @param string $abstract
|
|
|
+ * @param string $class
|
|
|
* @return void
|
|
|
*/
|
|
|
public static function extend($abstract, $class)
|
|
|
@@ -1791,9 +1738,8 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Set form field alias.
|
|
|
*
|
|
|
- * @param string $field
|
|
|
- * @param string $alias
|
|
|
- *
|
|
|
+ * @param string $field
|
|
|
+ * @param string $alias
|
|
|
* @return void
|
|
|
*/
|
|
|
public static function alias($field, $alias)
|
|
|
@@ -1804,8 +1750,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Find field class.
|
|
|
*
|
|
|
- * @param string $method
|
|
|
- *
|
|
|
+ * @param string $method
|
|
|
* @return bool|mixed
|
|
|
*/
|
|
|
public static function findFieldClass($method)
|
|
|
@@ -1827,8 +1772,7 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Getter.
|
|
|
*
|
|
|
- * @param string $name
|
|
|
- *
|
|
|
+ * @param string $name
|
|
|
* @return array|mixed
|
|
|
*/
|
|
|
public function __get($name)
|
|
|
@@ -1839,8 +1783,8 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Setter.
|
|
|
*
|
|
|
- * @param string $name
|
|
|
- * @param mixed $value
|
|
|
+ * @param string $name
|
|
|
+ * @param mixed $value
|
|
|
*/
|
|
|
public function __set($name, $value)
|
|
|
{
|
|
|
@@ -1850,9 +1794,8 @@ class Form implements Renderable
|
|
|
/**
|
|
|
* Generate a Field object and add to form builder if Field exists.
|
|
|
*
|
|
|
- * @param string $method
|
|
|
- * @param array $arguments
|
|
|
- *
|
|
|
+ * @param string $method
|
|
|
+ * @param array $arguments
|
|
|
* @return Field
|
|
|
*/
|
|
|
public function __call($method, $arguments)
|