Exemplo n.º 1
0
use source\LuLu;
use source\models\Content;
/* @var $this yii\web\View */
/* @var $searchModel app\models\search\ContentSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$type = 'post';
$this->title = '';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="content-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a('新建' . Content::getTypes($type), ['create', 'type' => $type], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'id', 'headerOptions' => ['style' => 'width:80px;']], 'title', ['attribute' => 'updated_at', 'format' => 'datetime', 'headerOptions' => ['style' => 'width:200px;']], ['attribute' => 'user_id', 'headerOptions' => ['style' => 'width:80px;']], ['attribute' => 'comments', 'headerOptions' => ['style' => 'width:80px;']], ['attribute' => 'views', 'headerOptions' => ['style' => 'width:80px;']], ['attribute' => 'status', 'headerOptions' => ['style' => 'width:80px;']], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>