@@ -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 | } |
@@ -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> |
@@ -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,12 +27,12 @@ discard block |
||
| 27 | 27 | 'pluginOptions'=>[ |
| 28 | 28 | 'placeholder' => $widget->placeHolders['country'], |
| 29 | 29 | ], |
| 30 | - ]);?> |
|
| 31 | - <?= $countryDisabled ? $form->field($model, 'country')->hiddenInput(['value'=> $country->getIsoAlpha2()])->label(false) : null ?> |
|
| 30 | + ]); ?> |
|
| 31 | + <?= $countryDisabled ? $form->field($model, 'country')->hiddenInput(['value'=> $country->getIsoAlpha2()])->label(false) : null ?> |
|
| 32 | 32 | </div> |
| 33 | 33 | |
| 34 | 34 | <div class="col-sm-6"> |
| 35 | - <?php if(is_null($country)):?> |
|
| 35 | + <?php if (is_null($country)):?> |
|
| 36 | 36 | <?= $form->field($model, 'state')->widget(DepDrop::class, [ |
| 37 | 37 | 'type'=>DepDrop::TYPE_SELECT2, |
| 38 | 38 | 'select2Options'=>['pluginOptions'=>['allowClear'=>true]], |
@@ -43,14 +43,14 @@ discard block |
||
| 43 | 43 | 'loadingText' => Yii::t("addressform", "Loading") . "...", |
| 44 | 44 | 'value' => !is_null($country) ? (new AddressHelper())->formatList($country->getDivisions()) : [], |
| 45 | 45 | ], |
| 46 | - ]);?> |
|
| 46 | + ]); ?> |
|
| 47 | 47 | <?php else:?> |
| 48 | 48 | <?= $form->field($model, 'state')->widget(Select2::class, [ |
| 49 | - 'data'=> ArrayHelper::map((new AddressHelper())->formatList($country->getDivisions()),'id', 'name'), |
|
| 49 | + 'data'=> ArrayHelper::map((new AddressHelper())->formatList($country->getDivisions()), 'id', 'name'), |
|
| 50 | 50 | 'options' => [ |
| 51 | 51 | 'placeholder' => $widget->placeHolders['state'], |
| 52 | 52 | ], |
| 53 | - ]);?> |
|
| 54 | - <?php endif;?> |
|
| 53 | + ]); ?> |
|
| 54 | + <?php endif; ?> |
|
| 55 | 55 | </div> |
| 56 | 56 | </div> |
@@ -22,7 +22,7 @@ |
||
| 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?> |
| 28 | 28 | <?= Html::endTag("div")?> |
| 29 | 29 | \ No newline at end of file |