Ejemplo n.º 1
0
        <?php 
echo $form->field($model, 'menu_category_id')->dropDownList(MenuCategory::getList(), ['prompt' => Yii::t('app', 'เลือก')]);
?>
    </div>   
    <div class="col-sm-6">  
        <?php 
echo $form->field($model, 'parent_id')->dropDownList(Menu::getList(), ['prompt' => Yii::t('app', 'เลือก')]);
?>
    </div> 
</div> 


<div class="row">   
    <div class="col-sm-3">
        <?php 
echo $form->field($model, 'status')->dropDownList(Menu::getItemStatus(), ['prompt' => Yii::t('app', 'เลือก')]);
?>
    </div>   

    <div class="col-sm-3">  
        <?php 
echo $form->field($model, 'items')->widget(Select2::ClassName(), ['data' => Menu::getAuth(), 'options' => ['placeholder' => 'Select a color ...', 'multiple' => true], 'pluginOptions' => ['tags' => true, 'maximumInputLength' => 10]]);
?>
    </div>   
    <div class="col-sm-3">  
        <?php 
echo $form->field($model, 'protocol')->textInput(['maxlength' => true]);
?>
    </div>   
    <div class="col-sm-3">  
        <?php 
Ejemplo n.º 2
0
//use kartik\widgets\Select2;
/* @var $this yii\web\View */
/* @var $searchModel firdows\menu\models\MenuSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('menu', 'ระบบจัดการเมนู');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class='box box-info'>
    <div class='box-header'>
     <h3 class='box-title'><?php 
echo Html::encode($this->title);
?>
</h3>
    </div><!--box-header -->

    <div class='box-body pad'>

        <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'name', 'format' => 'html', 'value' => function ($model) {
    return Html::a($model->iconShow . ' ' . $model->title, ['/menu/default/view', 'id' => $model->id]);
}], ['attribute' => 'menu_category_id', 'filter' => MenuCategory::getList(), 'value' => function ($model) {
    return $model->menu_category_id ? $model->menuCategory->title : null;
}], ['attribute' => 'route', 'filter' => Menu::getRouterDistinct()], ['attribute' => 'parent_id', 'filter' => Menu::getParentDistinct(), 'value' => function ($model) {
    return $model->parentTitle;
}], ['attribute' => 'status', 'filter' => Menu::getItemStatus(), 'value' => 'statusLabel'], ['attribute' => 'items', 'filter' => Menu::getItemsListDistinct(), 'value' => 'itemsList', 'headerOptions' => ['width' => '200']], 'sort', ['class' => 'yii\\grid\\ActionColumn']]]);
?>


    </div><!--box-body pad-->
</div><!--box box-info-->