Exemple #1
0
        <?php 
echo $form->field($model, 'type')->dropDownList(Vendor::enums('TYPE_'), ['style' => 'width:30%']);
?>
        <?php 
echo $form->field($model, 'code')->textInput(['maxlength' => true, 'style' => 'width:40%']);
?>
        <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
        <?php 
echo $form->field($model, 'contact_name')->textInput(['maxlength' => true]);
?>
        <?php 
echo $form->field($model, 'contact_number')->textInput(['maxlength' => true]);
?>
        <?php 
echo $form->field($model, 'status')->dropDownList(Vendor::enums('STATUS_'), ['style' => 'width:30%']);
?>
    
    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

<?php 
ActiveForm::end();
?>

</div>
Exemple #2
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
use backend\models\master\Vendor;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\master\search\Vendor */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = $searchModel->nmType ? ucfirst(strtolower($searchModel->nmType)) : 'Vendor';
$this->params['breadcrumbs'][] = $this->title;
?>
<p class='pull-right'>
    <?php 
echo Html::a('Create ' . ($searchModel->nmType ? ucfirst(strtolower($searchModel->nmType)) : 'Vendor'), ['create', 'type' => $searchModel->type], ['class' => 'btn btn-default']);
?>
</p>
<br>

<div class="vendor-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', 'contact_name', 'contact_number', ['attribute' => 'status', 'value' => 'nmStatus', 'filter' => Vendor::enums('STATUS_')], 'created_at:datetime', ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>