@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | use tonisormisson\addressform\AddressHelper; |
10 | 10 | use yii\helpers\ArrayHelper; |
11 | 11 | |
12 | -$country =$widget->getCountry(); |
|
12 | +$country = $widget->getCountry(); |
|
13 | 13 | $countryDisabled = !is_null($country); |
14 | 14 | ?> |
15 | 15 | |
@@ -27,11 +27,11 @@ discard block |
||
27 | 27 | 'pluginOptions'=>[ |
28 | 28 | 'placeholder' => $widget->placeHolders['country'], |
29 | 29 | ], |
30 | - ]);?> |
|
30 | + ]); ?> |
|
31 | 31 | </div> |
32 | 32 | |
33 | 33 | <div class="col-sm-6"> |
34 | - <?php if(is_null($country)):?> |
|
34 | + <?php if (is_null($country)):?> |
|
35 | 35 | <?= $form->field($model, 'state')->widget(DepDrop::class, [ |
36 | 36 | 'type'=>DepDrop::TYPE_SELECT2, |
37 | 37 | 'select2Options'=>['pluginOptions'=>['allowClear'=>true]], |
@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | 'loadingText' => Yii::t("addressform", "Loading") . "...", |
43 | 43 | 'value' => !is_null($country) ? (new AddressHelper())->formatList($country->getDivisions()) : [], |
44 | 44 | ], |
45 | - ]);?> |
|
45 | + ]); ?> |
|
46 | 46 | <?php else:?> |
47 | 47 | <?= $form->field($model, 'state')->widget(Select2::class, [ |
48 | - 'data'=> ArrayHelper::map((new AddressHelper())->formatList($country->getDivisions()),'id', 'name'), |
|
48 | + 'data'=> ArrayHelper::map((new AddressHelper())->formatList($country->getDivisions()), 'id', 'name'), |
|
49 | 49 | 'options' => [ |
50 | 50 | 'placeholder' => $widget->placeHolders['state'], |
51 | 51 | ], |
52 | - ]);?> |
|
53 | - <?php endif;?> |
|
52 | + ]); ?> |
|
53 | + <?php endif; ?> |
|
54 | 54 | </div> |
55 | 55 | </div> |
@@ -43,13 +43,16 @@ |
||
43 | 43 | 'value' => !is_null($country) ? (new AddressHelper())->formatList($country->getDivisions()) : [], |
44 | 44 | ], |
45 | 45 | ]);?> |
46 | - <?php else:?> |
|
46 | + <?php else { |
|
47 | + :?> |
|
47 | 48 | <?= $form->field($model, 'state')->widget(Select2::class, [ |
48 | 49 | 'data'=> ArrayHelper::map((new AddressHelper())->formatList($country->getDivisions()),'id', 'name'), |
49 | 50 | 'options' => [ |
50 | 51 | 'placeholder' => $widget->placeHolders['state'], |
51 | 52 | ], |
52 | - ]);?> |
|
53 | + ]); |
|
54 | +} |
|
55 | +?> |
|
53 | 56 | <?php endif;?> |
54 | 57 | </div> |
55 | 58 | </div> |