Form
in package
Table of Contents
Methods
- begin() : Form
- Begins a new HTML form element.
- end() : void
- Ends the HTML form element.
- field() : Field
- Creates a form field for the given model and attribute.
- meterField() : MeterField
- progressField() : ProgressField
- Creates a progress form field for the given model and attribute.
- selectField() : SelectField
- Creates a select form field for the given model and attribute.
- textareaField() : TextareaField
- Creates a textarea form field for the given model and attribute.
Methods
begin()
Begins a new HTML form element.
public
static begin(string $action, string $method[, array<string|int, mixed> $options = [] ]) : Form
Parameters
- $action : string
-
The action attribute value for the form
- $method : string
-
The method attribute value for the form
- $options : array<string|int, mixed> = []
-
Additional HTML attributes for the form
Return values
Form —Returns an instance of the Form class
end()
Ends the HTML form element.
public
static end() : void
This function outputs the closing </form> tag to properly close
the HTML form that was started with the begin method. It should be called
exactly once for every call to begin to ensure valid HTML structure.
field()
Creates a form field for the given model and attribute.
public
field(Model $model, string $attribute) : Field
Parameters
- $model : Model
-
The model instance to create the field for
- $attribute : string
-
The name of the attribute to create the field for
Return values
Field —Returns a new Field instance
meterField()
public
meterField(Model $model, mixed $attribute) : MeterField
Parameters
- $model : Model
- $attribute : mixed
Return values
MeterFieldprogressField()
Creates a progress form field for the given model and attribute.
public
progressField(Model $model, string $attribute) : ProgressField
Parameters
- $model : Model
-
The model instance to create the field for
- $attribute : string
-
The name of the attribute to create the field for
Return values
ProgressField —Returns a new ProgressField instance
selectField()
Creates a select form field for the given model and attribute.
public
selectField(Model $model, string $attribute) : SelectField
Parameters
- $model : Model
-
The model instance to create the field for
- $attribute : string
-
The name of the attribute to create the field for
Return values
SelectField —Returns a new SelectField instance
textareaField()
Creates a textarea form field for the given model and attribute.
public
textareaField(Model $model, string $attribute) : TextareaField
Parameters
- $model : Model
-
The model instance to create the field for
- $attribute : string
-
The name of the attribute to create the field for
Return values
TextareaField —Returns a new TextareaField instance