@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | //[['code'], 'string', 'max' => 64], |
138 | 138 | [ |
139 | 139 | ['code'], |
140 | - function ($attribute) { |
|
140 | + function($attribute) { |
|
141 | 141 | if (!preg_match('/^[a-zA-Z]{1}[a-zA-Z0-9]{1,255}$/', |
142 | 142 | $this->$attribute)) |
143 | 143 | //if(!preg_match('/(^|.*\])([\w\.]+)(\[.*|$)/', $this->$attribute)) |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | [ |
154 | 154 | 'code', |
155 | 155 | 'default', |
156 | - 'value' => function ($model, $attribute) { |
|
156 | + 'value' => function($model, $attribute) { |
|
157 | 157 | return "property" . StringHelper::ucfirst(md5(rand(1, 10) . time())); |
158 | 158 | } |
159 | 159 | ], |
@@ -139,13 +139,14 @@ |
||
139 | 139 | ['code'], |
140 | 140 | function ($attribute) { |
141 | 141 | if (!preg_match('/^[a-zA-Z]{1}[a-zA-Z0-9]{1,255}$/', |
142 | - $this->$attribute)) |
|
143 | - //if(!preg_match('/(^|.*\])([\w\.]+)(\[.*|$)/', $this->$attribute)) |
|
142 | + $this->$attribute)) { |
|
143 | + //if(!preg_match('/(^|.*\])([\w\.]+)(\[.*|$)/', $this->$attribute)) |
|
144 | 144 | { |
145 | 145 | $this->addError($attribute, \Yii::t('skeeks/cms', |
146 | 146 | 'Use only letters of the alphabet in lower or upper case and numbers, the first character of the letter (Example {code})', |
147 | 147 | ['code' => 'code1'])); |
148 | 148 | } |
149 | + } |
|
149 | 150 | } |
150 | 151 | ], |
151 | 152 |