code: 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.');
          }
      }
docs: {@inheritdoc}