Yii 1.1: fhex-validator

allow only hexadecimal digit characters
1 follower

FHexValidator verifies if the attribute represents only hexadecimal digit characters.

Requirements

  • Yii 1.1.7 or above...

Installation

  • Extract the release file under protected/extensions/validators
  • Extract the message file under protected if you wish user messages in your language and translate the messages in your language

Usage

In the model we use:

public function rules()
{
   return array(
      array('<attributeName>', 'ext.validators.FHexValidator')
   )
}

Configuration parameters

Parameter Default value Comment
attributes list (array)) of attributes to be validated
message the user-defined error message
skipOnError
on List of scenarios that the validator should be applied. Each array value refers to a scenario name with the same name as its array key.
safe true whether attributes listed with this validator should be considered safe for massive assignment
enableClientValidation true whether to perform client-side validation
allowEmpty true whether the attribute value can be null or empty

Resources

Be the first person to leave a comment

Please to leave your comment.

Create extension