widgets\ActiveField error()

error() public method

Generates a tag that contains the first validation error of $attribute.

Note that even if there is no validation error, this method will still return an empty error tag.

See also $errorOptions.

public $this error ( $options = [] )
$options array|false

The tag options in terms of name-value pairs. It will be merged with $errorOptions. The options will be rendered as the attributes of the resulting tag. The values will be HTML-encoded using yii\helpers\Html::encode(). If this parameter is false, no error tag will be rendered.

The following options are specially handled:

If you set a custom id for the error element, you may need to adjust the $selectors accordingly.

return $this

The field object itself.

doc_Yii
2016-10-30 17:17:50
Comments
Leave a Comment

Please login to continue.