Field
extends BaseField
in package
The Field class extends BaseField and handles form fields.
It contains methods for creating different types of form fields.
Table of Contents
Constants
- TYPE_BUTTON : mixed = 'button'
- TYPE_CHECKBOX : mixed = 'checkbox'
- TYPE_COLOR : mixed = 'color'
- TYPE_DATE : mixed = 'date'
- TYPE_DATETIME_LOCAL : mixed = 'datetime-local'
- TYPE_EMAIL : mixed = 'email'
- TYPE_FILE : mixed = 'file'
- TYPE_HIDDEN : mixed = 'hidden'
- TYPE_IMAGE : mixed = 'image'
- TYPE_MONTH : mixed = 'month'
- TYPE_NUMBER : mixed = 'number'
- TYPE_PASSWORD : mixed = 'password'
- TYPE_RADIO : mixed = 'radio'
- TYPE_RANGE : mixed = 'range'
- TYPE_RESET : mixed = 'reset'
- TYPE_SEARCH : mixed = 'search'
- TYPE_SUBMIT : mixed = 'submit'
- TYPE_TEL : mixed = 'tel'
- TYPE_TEXT : mixed = 'text'
- TYPE_TIME : mixed = 'time'
- TYPE_URL : mixed = 'url'
- TYPE_WEEK : mixed = 'week'
Properties
- $attribute : string
- $model : Model
- $type : string
Methods
- __construct() : mixed
- Field constructor.
- __toString() : string
- Returns the HTML representation of the field including label, input and error message.
- buttonField() : Field
- Sets the field type to button.
- checkboxField() : Field
- Sets the field type to checkbox.
- colorField() : Field
- Sets the field type to color.
- dateField() : Field
- Sets the field type to date.
- datetimeLocalField() : Field
- Sets the field type to datetime-local.
- emailField() : Field
- Sets the field type to email.
- fileField() : Field
- Sets the field type to file.
- hiddenField() : Field
- Sets the field type to hidden.
- imageField() : Field
- Sets the field type to image.
- monthField() : Field
- Sets the field type to month.
- numberField() : Field
- Sets the field type to number.
- passwordField() : Field
- Sets the field type to password.
- radioField() : Field
- Sets the field type to radio button.
- rangeField() : Field
- Sets the field type to range.
- renderInput() : string
- Renders the HTML for the form field.
- resetField() : Field
- Sets the field type to reset.
- searchField() : Field
- Sets the field type to search.
- submitField() : Field
- Sets the field type to submit.
- telField() : Field
- Sets the field type to telephone.
- timeField() : Field
- Sets the field type to time.
- urlField() : Field
- Sets the field type to URL.
- weekField() : Field
- Sets the field type to week.
Constants
TYPE_BUTTON
public
mixed
TYPE_BUTTON
= 'button'
TYPE_CHECKBOX
public
mixed
TYPE_CHECKBOX
= 'checkbox'
TYPE_COLOR
public
mixed
TYPE_COLOR
= 'color'
TYPE_DATE
public
mixed
TYPE_DATE
= 'date'
TYPE_DATETIME_LOCAL
public
mixed
TYPE_DATETIME_LOCAL
= 'datetime-local'
TYPE_EMAIL
public
mixed
TYPE_EMAIL
= 'email'
TYPE_FILE
public
mixed
TYPE_FILE
= 'file'
TYPE_HIDDEN
public
mixed
TYPE_HIDDEN
= 'hidden'
TYPE_IMAGE
public
mixed
TYPE_IMAGE
= 'image'
TYPE_MONTH
public
mixed
TYPE_MONTH
= 'month'
TYPE_NUMBER
public
mixed
TYPE_NUMBER
= 'number'
TYPE_PASSWORD
public
mixed
TYPE_PASSWORD
= 'password'
TYPE_RADIO
public
mixed
TYPE_RADIO
= 'radio'
TYPE_RANGE
public
mixed
TYPE_RANGE
= 'range'
TYPE_RESET
public
mixed
TYPE_RESET
= 'reset'
TYPE_SEARCH
public
mixed
TYPE_SEARCH
= 'search'
TYPE_SUBMIT
public
mixed
TYPE_SUBMIT
= 'submit'
TYPE_TEL
public
mixed
TYPE_TEL
= 'tel'
TYPE_TEXT
public
mixed
TYPE_TEXT
= 'text'
TYPE_TIME
public
mixed
TYPE_TIME
= 'time'
TYPE_URL
public
mixed
TYPE_URL
= 'url'
TYPE_WEEK
public
mixed
TYPE_WEEK
= 'week'
Properties
$attribute
public
string
$attribute
$model
public
Model
$model
$type
public
string
$type
Methods
__construct()
Field constructor.
public
__construct(Model $model, string $attribute) : mixed
Parameters
- $model : Model
- $attribute : string
__toString()
Returns the HTML representation of the field including label, input and error message.
public
__toString() : string
Return values
stringbuttonField()
Sets the field type to button.
public
buttonField() : Field
Return values
FieldcheckboxField()
Sets the field type to checkbox.
public
checkboxField() : Field
Return values
FieldcolorField()
Sets the field type to color.
public
colorField() : Field
Return values
FielddateField()
Sets the field type to date.
public
dateField() : Field
Return values
FielddatetimeLocalField()
Sets the field type to datetime-local.
public
datetimeLocalField() : Field
Return values
FieldemailField()
Sets the field type to email.
public
emailField() : Field
Return values
FieldfileField()
Sets the field type to file.
public
fileField() : Field
Return values
FieldhiddenField()
Sets the field type to hidden.
public
hiddenField() : Field
Return values
FieldimageField()
Sets the field type to image.
public
imageField() : Field
Return values
FieldmonthField()
Sets the field type to month.
public
monthField() : Field
Return values
FieldnumberField()
Sets the field type to number.
public
numberField() : Field
Return values
FieldpasswordField()
Sets the field type to password.
public
passwordField() : Field
Return values
FieldradioField()
Sets the field type to radio button.
public
radioField() : Field
Return values
FieldrangeField()
Sets the field type to range.
public
rangeField() : Field
Return values
FieldrenderInput()
Renders the HTML for the form field.
public
renderInput() : string
Return values
string —The HTML code for the form field
resetField()
Sets the field type to reset.
public
resetField() : Field
Return values
FieldsearchField()
Sets the field type to search.
public
searchField() : Field
Return values
FieldsubmitField()
Sets the field type to submit.
public
submitField() : Field
Return values
FieldtelField()
Sets the field type to telephone.
public
telField() : Field
Return values
FieldtimeField()
Sets the field type to time.
public
timeField() : Field
Return values
FieldurlField()
Sets the field type to URL.
public
urlField() : Field
Return values
FieldweekField()
Sets the field type to week.
public
weekField() : Field