/**
  * Lists all Branch models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new BranchSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());
     return $this->render('index', ['dataProvider' => $dataProvider, 'searchModel' => $searchModel]);
 }
Example #2
0
/**
 * @var yii\web\View $this
 * @var biz\models\Warehouse $model
 * @var yii\widgets\ActiveForm $form
 */
?>

<div class="warehouse-form">

    <?php 
$form = ActiveForm::begin();
?>
    <div class="box box-warning">
        <div class="box-body">
            <?php 
echo $form->field($model, 'id_branch')->dropDownList(ArrayHelper::map(Branch::find()->all(), 'id_branch', 'nm_branch'), ['style' => 'width:200px;']);
?>

            <?php 
echo $form->field($model, 'cd_whse')->textInput(['maxlength' => 4, 'style' => 'width:120px;']);
?>

            <?php 
echo $form->field($model, 'nm_whse')->textInput(['maxlength' => 32]);
?>
        </div>
        <div class="box-footer">
            <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
        </div>