base\Model isAttributeRequired()

isAttributeRequired() public method

Returns a value indicating whether the attribute is required.

This is determined by checking if the attribute is associated with a required validation rule in the current $scenario.

Note that when the validator has a conditional validation applied using $when this method will return false regardless of the when condition because it may be called be before the model is loaded with data.

public boolean isAttributeRequired ( $attribute )
$attribute string

Attribute name

return boolean

Whether the attribute is required

doc_Yii
2016-10-30 16:51:52
Comments
Leave a Comment

Please login to continue.