Documentation

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'
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

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
string

buttonField()

Sets the field type to button.

public buttonField() : Field
Return values
Field

checkboxField()

Sets the field type to checkbox.

public checkboxField() : Field
Return values
Field

colorField()

Sets the field type to color.

public colorField() : Field
Return values
Field

dateField()

Sets the field type to date.

public dateField() : Field
Return values
Field

datetimeLocalField()

Sets the field type to datetime-local.

public datetimeLocalField() : Field
Return values
Field

emailField()

Sets the field type to email.

public emailField() : Field
Return values
Field

fileField()

Sets the field type to file.

public fileField() : Field
Return values
Field

hiddenField()

Sets the field type to hidden.

public hiddenField() : Field
Return values
Field

imageField()

Sets the field type to image.

public imageField() : Field
Return values
Field

monthField()

Sets the field type to month.

public monthField() : Field
Return values
Field

numberField()

Sets the field type to number.

public numberField() : Field
Return values
Field

passwordField()

Sets the field type to password.

public passwordField() : Field
Return values
Field

radioField()

Sets the field type to radio button.

public radioField() : Field
Return values
Field

rangeField()

Sets the field type to range.

public rangeField() : Field
Return values
Field

renderInput()

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
Field

searchField()

Sets the field type to search.

public searchField() : Field
Return values
Field

submitField()

Sets the field type to submit.

public submitField() : Field
Return values
Field

telField()

Sets the field type to telephone.

public telField() : Field
Return values
Field

timeField()

Sets the field type to time.

public timeField() : Field
Return values
Field

urlField()

Sets the field type to URL.

public urlField() : Field
Return values
Field

weekField()

Sets the field type to week.

public weekField() : Field
Return values
Field
On this page

Search results