@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | - 'You must fill at least {min} of the attributes {attributes}.' => 'Se debe completar al menos {min} de los campos {attributes}.', |
|
| 5 | - ' or ' => ' o ', |
|
| 4 | + 'You must fill at least {min} of the attributes {attributes}.' => 'Se debe completar al menos {min} de los campos {attributes}.', |
|
| 5 | + ' or ' => ' o ', |
|
| 6 | 6 | ]; |
| 7 | 7 | |
@@ -82,13 +82,13 @@ |
||
| 82 | 82 | } elseif (! is_array($this->in) && count(preg_split('/\s*,\s*/', $this->in, -1, PREG_SPLIT_NO_EMPTY)) <= 1) { |
| 83 | 83 | throw new InvalidConfigException('The `in` parameter must have at least 2 attributes.'); |
| 84 | 84 | } |
| 85 | - if (!isset(Yii::$app->get('i18n')->translations['message*'])) { |
|
| 86 | - Yii::$app->get('i18n')->translations['message*'] = [ |
|
| 87 | - 'class' => PhpMessageSource::className(), |
|
| 88 | - 'basePath' => __DIR__ . '/messages', |
|
| 89 | - 'sourceLanguage' => 'en-US' |
|
| 90 | - ]; |
|
| 91 | - } |
|
| 85 | + if (!isset(Yii::$app->get('i18n')->translations['message*'])) { |
|
| 86 | + Yii::$app->get('i18n')->translations['message*'] = [ |
|
| 87 | + 'class' => PhpMessageSource::className(), |
|
| 88 | + 'basePath' => __DIR__ . '/messages', |
|
| 89 | + 'sourceLanguage' => 'en-US' |
|
| 90 | + ]; |
|
| 91 | + } |
|
| 92 | 92 | if ($this->message === null) { |
| 93 | 93 | $this->message = Yii::t('messages', 'You must fill at least {min} of the attributes {attributes}.'); |
| 94 | 94 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | parent::init(); |
| 80 | 80 | if ($this->in === null) { |
| 81 | 81 | throw new InvalidConfigException('The `in` parameter is required.'); |
| 82 | - } elseif (! is_array($this->in) && count(preg_split('/\s*,\s*/', $this->in, -1, PREG_SPLIT_NO_EMPTY)) <= 1) { |
|
| 82 | + } elseif (!is_array($this->in) && count(preg_split('/\s*,\s*/', $this->in, -1, PREG_SPLIT_NO_EMPTY)) <= 1) { |
|
| 83 | 83 | throw new InvalidConfigException('The `in` parameter must have at least 2 attributes.'); |
| 84 | 84 | } |
| 85 | 85 | if (!isset(Yii::$app->get('i18n')->translations['message*'])) { |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | foreach ($attributes as $attributeName) { |
| 106 | 106 | $value = $model->$attributeName; |
| 107 | - $attributesListLabels[] = '"' . $model->getAttributeLabel($attributeName). '"'; |
|
| 107 | + $attributesListLabels[] = '"' . $model->getAttributeLabel($attributeName) . '"'; |
|
| 108 | 108 | $chosen += !empty($value) ? 1 : 0; |
| 109 | 109 | } |
| 110 | 110 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | public function clientValidateAttribute($model, $attribute, $view) |
| 126 | 126 | { |
| 127 | 127 | $attributes = is_array($this->in) ? $this->in : preg_split('/\s*,\s*/', $this->in, -1, PREG_SPLIT_NO_EMPTY); |
| 128 | - $attributes = array_map('strtolower',$attributes); // yii lowercases attributes |
|
| 128 | + $attributes = array_map('strtolower', $attributes); // yii lowercases attributes |
|
| 129 | 129 | $attributesJson = json_encode($attributes); |
| 130 | 130 | |
| 131 | 131 | $attributesLabels = []; |