@@ -80,7 +80,7 @@ |
||
80 | 80 | |
81 | 81 | $countryList = []; |
82 | 82 | foreach ($this->countries as $country) { |
83 | - $countryList[$country->getIsoAlpha2()] = $country->getEmoji(). " " . $country->getName(); |
|
83 | + $countryList[$country->getIsoAlpha2()] = $country->getEmoji() . " " . $country->getName(); |
|
84 | 84 | } |
85 | 85 | return $countryList; |
86 | 86 | } |
@@ -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 | ?> |
14 | 14 | |
15 | 15 | |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | 'pluginOptions'=>[ |
30 | 30 | 'placeholder' => $widget->placeHolders['country'], |
31 | 31 | ], |
32 | - ]);?> |
|
32 | + ]); ?> |
|
33 | 33 | </div> |
34 | 34 | |
35 | 35 | <div class="col-sm-6"> |
36 | - <?php if(is_null($country)):?> |
|
36 | + <?php if (is_null($country)):?> |
|
37 | 37 | <?= $form->field($model, 'state')->widget(DepDrop::class, [ |
38 | 38 | 'type'=>DepDrop::TYPE_SELECT2, |
39 | 39 | 'options' => [ |
@@ -47,15 +47,15 @@ discard block |
||
47 | 47 | 'loadingText' => 'Loading child level 1 ...', |
48 | 48 | 'value' => !is_null($country) ? (new AddressHelper())->formatList($country->getDivisions()) : [], |
49 | 49 | ], |
50 | - ]);?> |
|
50 | + ]); ?> |
|
51 | 51 | <?php else:?> |
52 | 52 | <?= $form->field($model, 'state')->widget(Select2::class, [ |
53 | - 'data'=> ArrayHelper::map((new AddressHelper())->formatList($country->getDivisions()),'id', 'name'), |
|
53 | + 'data'=> ArrayHelper::map((new AddressHelper())->formatList($country->getDivisions()), 'id', 'name'), |
|
54 | 54 | 'options' => [ |
55 | 55 | 'id' => $widget->fieldIdPrefix . "-state", |
56 | 56 | 'placeholder' => $widget->placeHolders['state'], |
57 | 57 | ], |
58 | - ]);?> |
|
59 | - <?php endif;?> |
|
58 | + ]); ?> |
|
59 | + <?php endif; ?> |
|
60 | 60 | </div> |
61 | 61 | </div> |
@@ -48,14 +48,17 @@ |
||
48 | 48 | 'value' => !is_null($country) ? (new AddressHelper())->formatList($country->getDivisions()) : [], |
49 | 49 | ], |
50 | 50 | ]);?> |
51 | - <?php else:?> |
|
51 | + <?php else { |
|
52 | + :?> |
|
52 | 53 | <?= $form->field($model, 'state')->widget(Select2::class, [ |
53 | 54 | 'data'=> ArrayHelper::map((new AddressHelper())->formatList($country->getDivisions()),'id', 'name'), |
54 | 55 | 'options' => [ |
55 | 56 | 'id' => $widget->fieldIdPrefix . "-state", |
56 | 57 | 'placeholder' => $widget->placeHolders['state'], |
57 | 58 | ], |
58 | - ]);?> |
|
59 | + ]); |
|
60 | +} |
|
61 | +?> |
|
59 | 62 | <?php endif;?> |
60 | 63 | </div> |
61 | 64 | </div> |
@@ -22,6 +22,6 @@ |
||
22 | 22 | <?= (in_array('postCode', $widget->disabledFields)) ? null: $form->field($model, 'postCode')->textInput(['placeholder'=>$widget->placeHolders['postCode']]) ?> |
23 | 23 | </div> |
24 | 24 | </div> |
25 | - <?= empty($widget->form) ? Html::submitButton($widget->submitText,$widget->submitOptions) : null?> |
|
25 | + <?= empty($widget->form) ? Html::submitButton($widget->submitText, $widget->submitOptions) : null?> |
|
26 | 26 | |
27 | 27 | <?php (empty($widget->form)) ? ActiveForm::end() : null?> |