Displays the first validation error for a model attribute.
public error ( CModel $model, string $attribute, array $htmlOptions = [], boolean $enableAjaxValidation = true, boolean $enableClientValidation = true ) : string | ||
$model | CModel | the data model |
$attribute | string | the attribute name |
$htmlOptions | array | additional HTML attributes to be rendered in the container div tag. |
$enableAjaxValidation | boolean | whether to enable AJAX validation for the specified attribute. |
$enableClientValidation | boolean | whether to enable client-side validation for the specified attribute. |
return | string | the validation result (error display or success message). |