Exemplo n.º 1
0
            </p>
            <p class="pull-right">
                <?php 
echo Html::a('<i class="glyphicon glyphicon-th-large"></i> ' . Module::t('module', 'BUTTON_CATEGORIES'), ['category/index'], ['class' => 'btn btn-primary']);
?>
                <?php 
echo Html::a('<i class="glyphicon glyphicon-tags"></i> ' . Module::t('module', 'BUTTON_TAGS'), ['tags/index'], ['class' => 'btn btn-primary']);
?>
                <?php 
echo Html::a('<i class="glyphicon glyphicon-comment"></i> ' . Module::t('module', 'BUTTON_COMMENTS') . ' <span class="badge">' . $countPending . '</span>', ['comment/index'], ['class' => 'btn btn-primary']);
?>
            </p>
        </div>
    </div>

    <?php 
$gridColumn = [['class' => 'yii\\grid\\SerialColumn'], ['class' => LinkColumn::className(), 'attribute' => 'title'], ['attribute' => 'author_id', 'label' => Module::t('module', 'LABEL_AUTHOR'), 'format' => 'text', 'content' => function ($data) {
    return $data->getAuthorName();
}, 'filter' => Post::getAuthorList()], ['filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'date_from', 'attribute2' => 'date_to', 'type' => DatePicker::TYPE_RANGE, 'separator' => '-', 'pluginOptions' => ['format' => 'yyyy-mm-dd', 'todayHighlight' => true]]), 'attribute' => 'created_at', 'format' => ['date', 'php:d M Y г., H:i:s']], ['filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'dateUpd_from', 'attribute2' => 'dateUpd_to', 'type' => DatePicker::TYPE_RANGE, 'separator' => '-', 'pluginOptions' => ['format' => 'yyyy-mm-dd', 'todayHighlight' => true]]), 'attribute' => 'updated_at', 'format' => ['date', 'php:d M Y г., H:i:s']], ['class' => SetColumn::className(), 'attribute' => 'publish_status', 'filter' => Post::getStatusesArray(), 'name' => function ($model) {
    return Post::getStatusTitle($model->publish_status);
}, 'cssCLasses' => [Post::STATUS_PUBLISH => 'success', Post::STATUS_DRAFT => 'default', Post::STATUS_ARCHIVE => 'info']], ['attribute' => 'category_id', 'label' => Module::t('module', 'LABEL_CATEGORY'), 'format' => 'text', 'content' => function ($data) {
    return $data->getCategoryTitle();
}, 'filter' => Post::getCategoryList()], ['class' => ActionColumn::className()]];
?>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $gridColumn, 'responsive' => true, 'hover' => true, 'pjax' => false, 'resizableColumns' => true, 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['index'], ['class' => 'btn btn-default', 'title' => Module::t('module', 'RESET_GRID')])], '{toggleData}'], 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-th-list"></i> ' . Html::encode($this->title) . '</h3>', 'type' => 'primary', 'before' => Html::a('<i class="glyphicon glyphicon-plus"></i> ' . Module::t('module', 'BUTTON_CREATE'), ['create'], ['class' => 'btn btn-success', 'data-pjax' => 0])]]);
?>

</div>