init() public méthode

public init ( )
 public function init()
 {
     parent::init();
     if ($this->message === null) {
         $this->message = Yii::t('yii', '{attribute} is not a valid mac-address.');
     }
 }
 public function init()
 {
     parent::init();
     if ($this->message === null) {
         $this->message = Yii::t('yii', '{attribute} "{value}" has already been taken.');
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (is_array($this->length)) {
         if (isset($this->length[0])) {
             $this->min = $this->length[0];
         }
         if (isset($this->length[1])) {
             $this->max = $this->length[1];
         }
         $this->length = null;
     }
     if ($this->encoding === null) {
         $this->encoding = Yii::$app->charset;
     }
     if ($this->message === null) {
         $this->message = Yii::t('yii', '{attribute} must be a string.');
     }
     if ($this->min !== null && $this->tooShort === null) {
         $this->tooShort = Yii::t('yii', '{attribute} should contain at least {min, number} {min, plural, one{character} other{characters}}.');
     }
     if ($this->max !== null && $this->tooLong === null) {
         $this->tooLong = Yii::t('yii', '{attribute} should contain at most {max, number} {max, plural, one{character} other{characters}}.');
     }
     if ($this->length !== null && $this->notEqual === null) {
         $this->notEqual = Yii::t('yii', '{attribute} should contain {length, number} {length, plural, one{character} other{characters}}.');
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->message === null) {
         $this->message = Yii::t('wb_correios', 'CEP invalid.');
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->message === null) {
         $this->message = $this->requiredValue === null ? Yii::t('yii', '{attribute} cannot be blank.') : Yii::t('yii', '{attribute} must be "{requiredValue}".');
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->message === null) {
         $this->message = Yii::t('yii', '{attribute} must be either "{true}" or "{false}".');
     }
 }
 public function init()
 {
     parent::init();
     if ($this->message === null) {
         $this->message = \Yii::t('errors', 'Wrong phone format.');
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->message === null) {
         $this->message = Yii::t('users', 'SIMPLE_PASSWORD');
     }
 }
 public function init()
 {
     if (!$this->message) {
         $this->message = \Yii::t('yii', 'The format of {attribute} is invalid.');
     }
     parent::init();
 }
 /**
  * Инициализация
  */
 public function init()
 {
     parent::init();
     if (empty($this->message)) {
         $this->message = Yii::t('main', 'Wrong uuid value');
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (!$this->message) {
         $this->message = Yii::t('main', 'Wrong JSON format');
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->message === null) {
         $this->message = Yii::t('app', '{attribute} is not a valid postcode.');
     }
 }
Exemple #13
0
 function init()
 {
     parent::init();
     if (!isset(Yii::$app->i18n->translations['yii2-rut'])) {
         Yii::$app->i18n->translations['yii2-rut'] = ['class' => 'yii\\i18n\\PhpMessageSource', 'basePath' => dirname(__FILE__) . '/messages'];
     }
 }
 public function init()
 {
     parent::init();
     if (!$this->message) {
         $this->message = Yii::t('app', '{attribute} is not a valid number.');
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->message === null) {
         $this->message = Yii::t('app', 'Неправильный формат поля {attribute}, имеются недопустимые символы.');
     }
 }
Exemple #16
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (!$this->message) {
         $this->message = \Yii::t('app', 'Given value has bad format');
     }
 }
 public function init()
 {
     parent::init();
     $this->_msgCat = 'creditcard';
     $this->initI18N(__DIR__);
     $this->message = Yii::t('creditcard', 'Expiry is invalid.');
 }
Exemple #18
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->message === null) {
         $this->message = \Yii::t('app', 'Неправильный формат телефона, ожидается формат +79001234567');
     }
 }
Exemple #19
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->message === null) {
         $this->message = Module::t('ERROR_VALIDATE_ARRAY');
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (empty($this->className)) {
         throw InvalidConfigException('Property "className" must be provided');
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->message === null) {
         switch ($this->operator) {
             case '==':
                 $this->message = Yii::t('yii', '{attribute} must be repeated exactly.');
                 break;
             case '===':
                 $this->message = Yii::t('yii', '{attribute} must be repeated exactly.');
                 break;
             case '!=':
                 $this->message = Yii::t('yii', '{attribute} must not be equal to "{compareValue}".');
                 break;
             case '!==':
                 $this->message = Yii::t('yii', '{attribute} must not be equal to "{compareValue}".');
                 break;
             case '>':
                 $this->message = Yii::t('yii', '{attribute} must be greater than "{compareValue}".');
                 break;
             case '>=':
                 $this->message = Yii::t('yii', '{attribute} must be greater than or equal to "{compareValue}".');
                 break;
             case '<':
                 $this->message = Yii::t('yii', '{attribute} must be less than "{compareValue}".');
                 break;
             case '<=':
                 $this->message = Yii::t('yii', '{attribute} must be less than or equal to "{compareValue}".');
                 break;
             default:
                 throw new InvalidConfigException("Unknown operator: {$this->operator}");
         }
     }
 }
 public function init()
 {
     parent::init();
     if ($this->message === null) {
         $this->message = Yii::t('app', 'Error on {attribute}.');
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->message === null) {
         $this->message = 'Error in expression';
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->schemaEmpty === null) {
         $this->schemaEmpty = 'The "schema" property must be set.';
     }
     if ($this->schemaNotString === null) {
         $this->schemaNotString = 'The "schema" property must be a a string.';
     }
     if ($this->message === null) {
         $this->message = Yii::t('app', '{property}: {message}.');
     }
     if ($this->notString === null) {
         $this->notString = Yii::t('app', 'The value must be a string.');
     }
     if ($this->notJsonString === null) {
         $this->notJsonString = Yii::t('app', 'The value must be a valid JSON string.');
     }
     if (empty($this->schema)) {
         throw new InvalidConfigException($this->schemaEmpty);
     }
     if (!is_string($this->schema)) {
         throw new InvalidConfigException($this->schemaNotString);
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->message === null) {
         $this->message = Yii::t('yii', '{attribute} is invalid.');
     }
 }
Exemple #26
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->message === null) {
         $this->message = Yii::t('admin', '"{attribute}" must be a valid JSON');
     }
 }
Exemple #27
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->filter === null) {
         throw new InvalidConfigException('The "filter" property must be set.');
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->message === null) {
         $this->message = '{attribute} contains invalid video code.';
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->message === null) {
         $this->message = Yii::t('yii', 'The verification code is incorrect.');
     }
 }
Exemple #30
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->message === null) {
         $this->message = $this->requiredValue === null ? Yii::t('yii', 'Please enter a value for {attribute}.') : Yii::t('yii', '{attribute} must be "{requiredValue}".');
     }
 }