PHP Class macgyer\yii2materializecss\widgets\form\ActiveField

See also: http://www.yiiframework.com/doc-2.0/yii-widgets-activefield.html
Author: Christoph Erdmann ([email protected])
Inheritance: extends yii\widgets\ActiveField
Show file Open project: macgyer/yii2-materializecss

Public Properties

Property Type Description
$errorOptions the default options for the error tags. The parameter passed to yii\widgets\ActiveField::error()-detail) will be merged with this property when rendering the error tag. The following special options are recognized: - tag: the tag name of the container element. Defaults to "div". - encode: whether to encode the error output. Defaults to true. If you set a custom id for the error element, you may need to adjust the yii\widgets\ActiveField::$selectors accordingly.
$hintOptions the default options for the hint tags. The parameter passed to yii\widgets\ActiveField::hint()-detail) will be merged with this property when rendering the hint tag. The following special options are recognized: - tag: the tag name of the container element. Defaults to "div".
$icon the options for the optional prefix icon. To specify an icon you can use the following parameters php [ 'name' => 'name of the icon', // required 'options' => 'the HTML attributes for the img', // optional ]
$inputOptions the default options for the input tags. The parameter passed to individual input methods (e.g. textInput()-detail)) will be merged with this property when rendering the input tag. If you set a custom id for the input element, you may need to adjust the $selectors accordingly.
$labelOptions the default options for the label tags. The parameter passed to label()-detail) will be merged with this property when rendering the label tag.
$options the HTML attributes (name-value pairs) for the field container tag. The values will be HTML-encoded using Html::encode()-detail). If a value is null, the corresponding attribute will not be rendered. The following special options are recognized: - tag: the tag name of the container element. Defaults to "div". If you set a custom id for the container element, you may need to adjust the $selectors accordingly.
$template the template that is used to arrange the label, the input field, the error message and the hint text. The following tokens will be replaced when ActiveField::render is called: {label}, {input}, {error} and {hint}.

Public Methods

Method Description
colorInput ( array $options = [] ) : ActiveField Renders a color input.
dateInput ( array $options = [] ) : ActiveField Renders a date input.
datetimeInput ( array $options = [] ) : ActiveField Renders a datetime input.
datetimeLocalInput ( array $options = [] ) : ActiveField Renders a datetime local input.
emailInput ( array $options = [] ) : ActiveField Renders an email input.
icon ( ) : ActiveField Renders an icon.
init ( ) Initializes the widget.
monthInput ( array $options = [] ) : ActiveField Renders a month input.
numberInput ( array $options = [] ) : ActiveField Renders a number input.
rangeInput ( array $options = [] ) : ActiveField Renders a range input.
render ( string | callable $content = null ) : string Renders the whole field.
searchInput ( array $options = [] ) : ActiveField Renders a search input.
telInput ( array $options = [] ) : ActiveField Renders a phone input.
textarea ( array $options = [] ) : ActiveField Renders a textarea.
timeInput ( array $options = [] ) : ActiveField Renders a time input.
urlInput ( array $options = [] ) : ActiveField Renders an URL input.
weekInput ( array $options = [] ) : ActiveField Renders a week input.

Method Details

colorInput() public method

Renders a color input.
public colorInput ( array $options = [] ) : ActiveField
$options array
return ActiveField

dateInput() public method

Renders a date input.
public dateInput ( array $options = [] ) : ActiveField
$options array
return ActiveField

datetimeInput() public method

Renders a datetime input.
public datetimeInput ( array $options = [] ) : ActiveField
$options array
return ActiveField

datetimeLocalInput() public method

Renders a datetime local input.
public datetimeLocalInput ( array $options = [] ) : ActiveField
$options array
return ActiveField

emailInput() public method

Renders an email input.
public emailInput ( array $options = [] ) : ActiveField
$options array
return ActiveField

icon() public method

Renders an icon.
public icon ( ) : ActiveField
return ActiveField

init() public method

Initializes the widget.
public init ( )

monthInput() public method

Renders a month input.
public monthInput ( array $options = [] ) : ActiveField
$options array
return ActiveField

numberInput() public method

Renders a number input.
public numberInput ( array $options = [] ) : ActiveField
$options array
return ActiveField

rangeInput() public method

Renders a range input.
public rangeInput ( array $options = [] ) : ActiveField
$options array
return ActiveField

render() public method

This method will generate the label, error tag, input tag and hint tag (if any), and assemble them into HTML according to [[template]].
public render ( string | callable $content = null ) : string
$content string | callable the content within the field container. If null (not set), the default methods will be called to generate the label, error tag and input tag, and use them as the content. If a callable, it will be called to generate the content. The signature of the callable should be: ```php function ($field) { return $html; } ```
return string the rendering result

searchInput() public method

Renders a search input.
public searchInput ( array $options = [] ) : ActiveField
$options array
return ActiveField

telInput() public method

Renders a phone input.
public telInput ( array $options = [] ) : ActiveField
$options array
return ActiveField

textarea() public method

Renders a textarea.
public textarea ( array $options = [] ) : ActiveField
$options array
return ActiveField

timeInput() public method

Renders a time input.
public timeInput ( array $options = [] ) : ActiveField
$options array
return ActiveField

urlInput() public method

Renders an URL input.
public urlInput ( array $options = [] ) : ActiveField
$options array
return ActiveField

weekInput() public method

Renders a week input.
public weekInput ( array $options = [] ) : ActiveField
$options array
return ActiveField

Property Details

$errorOptions public property

the default options for the error tags. The parameter passed to yii\widgets\ActiveField::error()-detail) will be merged with this property when rendering the error tag. The following special options are recognized: - tag: the tag name of the container element. Defaults to "div". - encode: whether to encode the error output. Defaults to true. If you set a custom id for the error element, you may need to adjust the yii\widgets\ActiveField::$selectors accordingly.
See also: [\yii\helpers\Html::renderTagAttributes()](http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#renderTagAttributes()-detail) for details on how attributes are being rendered.
public $errorOptions

$hintOptions public property

the default options for the hint tags. The parameter passed to yii\widgets\ActiveField::hint()-detail) will be merged with this property when rendering the hint tag. The following special options are recognized: - tag: the tag name of the container element. Defaults to "div".
See also: [\yii\helpers\Html::renderTagAttributes()](http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#renderTagAttributes()-detail) for details on how attributes are being rendered.
public $hintOptions

$icon public property

the options for the optional prefix icon. To specify an icon you can use the following parameters php [ 'name' => 'name of the icon', // required 'options' => 'the HTML attributes for the img', // optional ]
public $icon

$inputOptions public property

the default options for the input tags. The parameter passed to individual input methods (e.g. textInput()-detail)) will be merged with this property when rendering the input tag. If you set a custom id for the input element, you may need to adjust the $selectors accordingly.
See also: [\yii\helpers\Html::renderTagAttributes()](http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#renderTagAttributes()-detail) for details on how attributes are being rendered.
public $inputOptions

$labelOptions public property

the default options for the label tags. The parameter passed to label()-detail) will be merged with this property when rendering the label tag.
See also: [\yii\helpers\Html::renderTagAttributes()](http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#renderTagAttributes()-detail) for details on how attributes are being rendered.
public $labelOptions

$options public property

the HTML attributes (name-value pairs) for the field container tag. The values will be HTML-encoded using Html::encode()-detail). If a value is null, the corresponding attribute will not be rendered. The following special options are recognized: - tag: the tag name of the container element. Defaults to "div". If you set a custom id for the container element, you may need to adjust the $selectors accordingly.
See also: [\yii\helpers\Html::renderTagAttributes()](http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#renderTagAttributes()-detail) for details on how attributes are being rendered.
public $options

$template public property

the template that is used to arrange the label, the input field, the error message and the hint text. The following tokens will be replaced when ActiveField::render is called: {label}, {input}, {error} and {hint}.
public $template