Example #1
0
<?php

use yii\helpers\Html;
use app\models\Countries;
use yii\widgets\Pjax;
/* @var $id_country integer */
/* @var $state app\models\States */
/* @var $this \yii\web\View */
$countries = Countries::getList();
?>

<div class="row">

    <div class="col-xs-5">

       <?php 
echo Html::beginForm(['ajax/pjax'], 'get');
?>
       <?php 
echo Html::label('Select country to edit states/regions', 'country');
?>

       <?php 
echo Html::dropDownList('id_country', $id_country, $countries, ['prompt' => 'select country', 'id' => 'country', 'class' => 'form-control', 'onchange' => 'this.form.submit()']);
?>
       <?php 
echo Html::endForm();
?>
    </div>

    <div class="col-xs-5 col-xs-offset-2">