¨4.0.1¨
This commit is contained in:
@@ -10,48 +10,49 @@ class Form
|
||||
|
||||
protected $unnecessaryAttributes = ['disabled', 'readonly', 'checked'];
|
||||
|
||||
|
||||
public function text($name, $title, $errors, $entity = null, $options = [])
|
||||
{
|
||||
return $this->input($name, $title, $errors, $entity, array_merge($options, ['type' => 'text']));
|
||||
}
|
||||
|
||||
public function password($name, $title, $errors, $entity = null, $options = [])
|
||||
{
|
||||
return $this->input($name, $title, $errors, $entity, array_merge($options, ['type' => 'password']));
|
||||
}
|
||||
|
||||
public function number($name, $title, $errors, $entity = null, $options = [])
|
||||
{
|
||||
return $this->input($name, $title, $errors, $entity, array_merge($options, ['type' => 'number']));
|
||||
}
|
||||
|
||||
public function email($name, $title, $errors, $entity = null, $options = [])
|
||||
{
|
||||
return $this->input($name, $title, $errors, $entity, array_merge($options, ['type' => 'email']));
|
||||
}
|
||||
|
||||
public function file($name, $title, $errors, $entity = null, $options = [])
|
||||
{
|
||||
return $this->input($name, $title, $errors, $entity, array_merge($options, ['type' => 'file']));
|
||||
}
|
||||
|
||||
public function color($name, $title, $errors, $entity = null, $options = [])
|
||||
{
|
||||
return $this->input($name, $title, $errors, $entity, array_merge($options, ['type' => 'color']));
|
||||
}
|
||||
|
||||
public function input($name, $title, $errors, $entity = null, $options = [])
|
||||
{
|
||||
return $this->field($name, $title, $errors, $entity, $options, [$this, 'inputField']);
|
||||
}
|
||||
|
||||
public function textarea($name, $title, $errors, $entity = null, $options = [])
|
||||
{
|
||||
$options = array_merge(['rows' => 10, 'cols' => 10], $options);
|
||||
|
||||
return $this->field($name, $title, $errors, $entity, $options, [$this, 'textareaField']);
|
||||
public function password($name, $title, $errors, $entity = null, $options = [])
|
||||
{
|
||||
return $this->input($name, $title, $errors, $entity, array_merge($options, ['type' => 'password']));
|
||||
}
|
||||
|
||||
|
||||
public function number($name, $title, $errors, $entity = null, $options = [])
|
||||
{
|
||||
return $this->input($name, $title, $errors, $entity, array_merge($options, ['type' => 'number']));
|
||||
}
|
||||
|
||||
|
||||
public function email($name, $title, $errors, $entity = null, $options = [])
|
||||
{
|
||||
return $this->input($name, $title, $errors, $entity, array_merge($options, ['type' => 'email']));
|
||||
}
|
||||
|
||||
|
||||
public function file($name, $title, $errors, $entity = null, $options = [])
|
||||
{
|
||||
return $this->input($name, $title, $errors, $entity, array_merge($options, ['type' => 'file']));
|
||||
}
|
||||
|
||||
|
||||
public function color($name, $title, $errors, $entity = null, $options = [])
|
||||
{
|
||||
return $this->input($name, $title, $errors, $entity, array_merge($options, ['type' => 'color']));
|
||||
}
|
||||
|
||||
|
||||
public function wysiwyg($name, $title, $errors, $entity = null, $options = [])
|
||||
{
|
||||
$options['class'] = array_get($options, 'class', '') . ' wysiwyg';
|
||||
@@ -59,11 +60,21 @@ class Form
|
||||
return $this->textarea($name, $title, $errors, $entity, $options);
|
||||
}
|
||||
|
||||
|
||||
public function textarea($name, $title, $errors, $entity = null, $options = [])
|
||||
{
|
||||
$options = array_merge(['rows' => 10, 'cols' => 10], $options);
|
||||
|
||||
return $this->field($name, $title, $errors, $entity, $options, [$this, 'textareaField']);
|
||||
}
|
||||
|
||||
|
||||
public function checkbox($name, $title, $label, $errors, $entity = null, $options = [])
|
||||
{
|
||||
return $this->field($name, $title, $errors, $entity, $options, [$this, 'checkboxField'], $label);
|
||||
}
|
||||
|
||||
|
||||
public function select($name, $title, $errors, $list = [], $entity = null, $options = [])
|
||||
{
|
||||
return $this->field($name, $title, $errors, $entity, $options, [$this, 'selectField'], $list);
|
||||
|
||||
Reference in New Issue
Block a user