示例#1
0
    <div class="panel panel-default">
        <div class="panel-body">

            <div class="row">
                <div class="col-sm-12 text-right">
                    <?php 
echo GridPageSize::widget(['pjaxId' => 'album-grid-pjax']);
?>
                </div>
            </div>

            <?php 
Pjax::begin(['id' => 'album-grid-pjax']);
?>

            <?php 
echo GridView::widget(['id' => 'album-grid', 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'bulkActionOptions' => ['gridId' => 'album-grid', 'actions' => [Url::to(['bulk-delete']) => Yii::t('yee', 'Delete')]], 'columns' => [['class' => 'yeesoft\\grid\\CheckboxColumn', 'options' => ['style' => 'width:10px']], ['class' => 'yeesoft\\grid\\columns\\TitleActionColumn', 'controller' => '/media/album', 'title' => function (Album $model) {
    return Html::a($model->title, ['/media/album/update', 'id' => $model->id], ['data-pjax' => 0]);
}, 'buttonsTemplate' => '{update} {delete}'], 'description:ntext', ['attribute' => 'category_id', 'filter' => Category::getCategories(true), 'value' => function (Album $model) {
    return $model->category instanceof Category ? $model->category->title : Yii::t('yii', '(not set)');
}, 'format' => 'raw'], ['class' => 'yeesoft\\grid\\columns\\StatusColumn', 'attribute' => 'visible']]]);
?>

            <?php 
Pjax::end();
?>
        </div>
    </div>
</div>
示例#2
0
                    <?php 
echo $form->field($model, 'description')->textarea(['rows' => 6]);
?>

                </div>

            </div>
        </div>

        <div class="col-md-3">

            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="record-info">
                        <?php 
echo $form->field($model, 'category_id')->dropDownList(Category::getCategories(true), ['prompt' => '']);
?>

                        <?php 
echo $form->field($model, 'visible')->checkbox();
?>

                        <div class="form-group">
                            <?php 
if ($model->isNewRecord) {
    ?>
                                <?php 
    echo Html::submitButton(Yii::t('yee', 'Create'), ['class' => 'btn btn-primary']);
    ?>
                                <?php 
    echo Html::a(Yii::t('yee', 'Cancel'), ['/media/album/index'], ['class' => 'btn btn-default']);