yii\validators\RegularExpressionValidator::init PHP Метод

init() публичный Метод

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

Пример #1
0
 /**
  * {@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