当前位置: 首页>>代码示例>>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;未经允许,请勿转载。