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