當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Article::get_status方法代碼示例

本文整理匯總了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);
開發者ID:specialnote,項目名稱:myYii,代碼行數:31,代碼來源:category.php

示例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>
開發者ID:specialnote,項目名稱:myYii,代碼行數:30,代碼來源:gather.php


注:本文中的common\models\Article::get_status方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。