本文整理汇总了PHP中common\models\Category::get_category方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::get_category方法的具体用法?PHP Category::get_category怎么用?PHP Category::get_category使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common\models\Category
的用法示例。
在下文中一共展示了Category::get_category方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
$this->title = '文章';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="article-index">
<?php
/* echo $this->render('_search', ['model' => $searchModel]); */
?>
<p>
<?php
echo Html::a('新建文章', ['create'], ['class' => 'btn btn-success']);
?>
<?php
echo Html::a('采集文章管理', ['/article/gather'], ['class' => 'btn btn-primary fr']);
?>
</p>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['id', ['attribute' => 'cover_img', 'format' => ['image', ['width' => '50']], 'value' => function ($model) {
return $model->cover_img;
}], ['attribute' => 'title', 'label' => '文章标题', 'format' => 'html', 'value' => function ($model) {
return '<b>' . $model->title . '</b>';
}, 'headerOptions' => ['width' => '300px']], ['attribute' => 'category_id', 'label' => '文章分类', 'value' => function ($model) {
return \common\models\Category::get_category_result($model->category_id);
}, 'filter' => \common\models\Category::get_category()], 'author', 'publish_at', 'view_count', 'share', ['attribute' => 'status', 'value' => function ($model) {
return $model->getStatusName($model->status);
}], ['class' => 'yii\\grid\\ActionColumn', 'header' => '操作', 'template' => '{view} {update} {delete}', 'headerOptions' => ['width' => '75']]], 'tableOptions' => ['class' => 'table table-striped table-hover']]);
?>
</div>