|
@@ -79,7 +79,7 @@ discard block |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 = []; |