use yii\helpers\Html; use yii\widgets\ActiveForm; /* @var $this yii\web\View */ /* @var $model backend\models\master\Branch */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="branch-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'orgn_id')->dropDownList(\backend\models\master\Orgn::selectOptions(), ['style' => 'width:40%;']); ?> <?php echo $form->field($model, 'code')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'addr')->textInput(['maxlength' => true]); ?> <div class="form-group">
<?php use yii\helpers\Html; use yii\grid\GridView; /* @var $this yii\web\View */ /* @var $searchModel backend\models\master\search\Branch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = 'Branches'; $this->params['breadcrumbs'][] = $this->title; ?> <p class='pull-right'> <?php echo Html::a('Create Branch', ['create'], ['class' => 'btn btn-default']); ?> </p> <br> <div class="branch-index"> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'table table-hover'], 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'code', 'name', 'addr', ['header' => 'Orgn', 'attribute' => 'orgn_id', 'value' => 'orgn.name', 'filter' => \backend\models\master\Orgn::selectOptions()], 'created_at:datetime', ['class' => 'yii\\grid\\ActionColumn']]]); ?> </div>