Documentation

TextareaField extends BaseField
in package

Class representing a multi-line text input field.

Used to create a textarea-type field in forms.

Table of Contents

Constants

TYPE_TEXTAREA  : mixed = 'textarea'

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.
renderInput()  : string
Renders the HTML input element for the textarea field.

Constants

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

renderInput()

Renders the HTML input element for the textarea field.

public renderInput() : string

This method generates the complete HTML markup for a textarea element, including appropriate classes based on validation state and any additional attributes from the model's property method. The content of the textarea is set to the attribute value from the model, with fallback to a value attribute if provided and no model value exists.

Return values
string

The HTML markup for the textarea input field

On this page

Search results