本文整理匯總了PHP中common\models\Article::get_status方法的典型用法代碼示例。如果您正苦於以下問題:PHP Article::get_status方法的具體用法?PHP Article::get_status怎麽用?PHP Article::get_status使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類common\models\Article
的用法示例。
在下文中一共展示了Article::get_status方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: function
} else {
return '';
}
}], ['attribute' => 'id', 'value' => function ($model) {
return $model->id;
}, 'headerOptions' => ['width' => '50px']], ['attribute' => 'category_id', 'value' => function ($model) {
return $model->getCategoryName();
}], ['header' => '<font style="color: #337ab7">標簽</font>', 'class' => yii\grid\Column::className(), 'content' => function ($model) {
return $model->getArticleTagToString();
}], ['attribute' => 'title', 'label' => '文章標題', 'format' => 'html', 'value' => function ($model) {
return '<b>' . $model->title . '</b>';
}], ['attribute' => 'publish_at', 'value' => function ($model) {
return $model->publish_at;
}, 'headerOptions' => ['width' => '100px']], ['attribute' => 'status', 'value' => function ($model) {
return $model->getStatusName($model->status);
}, 'headerOptions' => ['width' => '100px'], 'filter' => \common\models\Article::get_status()]], 'tableOptions' => ['class' => 'table table-striped table-hover']]);
?>
<?php
echo Html::endForm();
?>
</div>
<?php
$this->registerJs(<<<STR
\$(function(){
//全選、反選
var all = \$('#check-all');
var check = \$('.gather-article');
all.click(function(){
if(this.checked){
check.prop('checked',true);
示例2: function
<div class="article-index">
<p>
<?php
echo Html::a('批量發布文章', ['/article/publish'], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a('批量更改文章分類', ['/article/category'], ['class' => 'btn btn-primary']);
?>
</p>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'id', 'value' => function ($model) {
return $model->id;
}, 'headerOptions' => ['width' => '50px']], ['attribute' => 'category_id', 'value' => function ($model) {
return $model->getCategoryName();
}], ['header' => '<font style="color: #337ab7">標簽</font>', 'class' => yii\grid\Column::className(), 'content' => function ($model) {
return $model->getArticleTagToString();
}], ['attribute' => 'title', 'label' => '文章標題', 'format' => 'html', 'value' => function ($model) {
return '<b>' . $model->title . '</b>';
}], ['attribute' => 'publish_at', 'value' => function ($model) {
return $model->publish_at;
}, 'headerOptions' => ['width' => '100px']], ['attribute' => 'status', 'value' => function ($model) {
return $model->getStatusName($model->status);
}, 'headerOptions' => ['width' => '100px'], 'filter' => \common\models\Article::get_status()], ['class' => 'yii\\grid\\ActionColumn', 'header' => '<font style="color: #337ab7">操作</font>', 'template' => '{preview} {update} {delete}', 'buttons' => ['preview' => function ($url, $model, $key) {
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $url, ['title' => '預覽']);
}], 'headerOptions' => ['width' => '75']]], 'tableOptions' => ['class' => 'table table-striped table-hover']]);
?>
<?php
echo Html::endForm();
?>
</div>