src/widgets/LocationFormWidget.php
protected function region()
    {
        $pluginOptions = [
            'url' => Url::to(["/{$this->module->id}/region/list"])
            , 'depends' => [$this->fieldIds['country']]
        ];
        if (isset($this->fieldIds['state'])) {
            $pluginOptions['depends'][] = $this->fieldIds['state'];
            $pluginOptions['initDepends'] = [$this->fieldIds['country']];
        } else {
            $pluginOptions['depends'][] = null;
        }

        $this->parts['{region}'] = $this->form->field($this->model, $this->model->getRegionPropertyName())->widget(DepDrop::className(), [
            'options' => [
                'id' => $this->fieldIds['region']
                , 'placeholder' => Yii::t('jlorente/location', 'Select region')
                , 'name' => $this->getSubmitModelName($this->model->getRegionPropertyName())
            ]
            , 'data' => ArrayHelper::map(Region::find()->where(['country_id' => $this->model->country_id])->orderBy(['name' => SORT_ASC])->all(), 'id', 'name')
            , 'pluginOptions' => $pluginOptions
        ]);
    }
protected function region()
    {
        $pluginOptions = [
            'url' => Url::to(["/{$this->module->id}/region/list"])
            , 'depends' => [$this->fieldIds['country']]
        ];
        if (isset($this->fieldIds['state'])) {
            $pluginOptions['depends'][] = $this->fieldIds['state'];
            $pluginOptions['initDepends'] = [$this->fieldIds['country']];
        } else {
            $pluginOptions['depends'][] = null;
        }

        $this->parts['{region}'] = $this->form->field($this->model, $this->model->getRegionPropertyName())->widget(DepDrop::className(), [
            'options' => [
                'id' => $this->fieldIds['region']
                , 'placeholder' => Yii::t('jlorente/location', 'Select region')
                , 'name' => $this->getSubmitModelName($this->model->getRegionPropertyName())
            ]
            , 'data' => ArrayHelper::map(Region::find()->where(['country_id' => $this->model->country_id])->orderBy(['name' => SORT_ASC])->all(), 'id', 'name')
            , 'pluginOptions' => $pluginOptions
        ]);
    }
Renders the region part.