yii\validators\RegularExpressionValidator::init PHP Method

init() public method

public init ( )
    public function init()
    {
        parent::init();
        if ($this->pattern === null) {
            throw new InvalidConfigException('The "pattern" property must be set.');
        }
        if ($this->message === null) {
            $this->message = Yii::t('yii', '{attribute} is invalid.');
        }
    }

Usage Example

 /**
  * {@inheritdoc}
  */
 public function init()
 {
     parent::init();
     if ($this->message === null) {
         $this->message = Yii::t('hipanel', '{attribute} does not look like a valid domain name');
     }
 }
All Usage Examples Of yii\validators\RegularExpressionValidator::init