Esempio n. 1
0
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
//echo Html::a('添加', ['create'], ['class' => 'btn btn-success'])
?>
        <input type="button" class="btn btn-info" value="批量删除" id="MyButton" >
    </p>

    <?php 
Pjax::begin();
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\CheckboxColumn'], 'id', 'star', 'content:ntext', ['attribute' => 'type', 'value' => function ($model) {
    return \common\models\Labels::getLabel($model->type, "type");
}, 'filter' => Html::activeDropDownList($searchModel, 'type', Yii::$app->params['type'], ['class' => 'form-control', 'prompt' => Yii::t('app', 'Please Filter')])], ['attribute' => 'status', 'format' => 'html', 'value' => function ($model) {
    if ($model->status === Status::STATUS_ACTIVE) {
        $class = 'label-success';
    } elseif ($model->status === Status::STATUS_DELETED) {
        $class = 'label-warning';
    } else {
        $class = 'label-danger';
    }
    return '<span class="label ' . $class . '">' . Status::labels($model->status) . '</span>';
}, 'filter' => Html::activeDropDownList($searchModel, 'status', Status::labels(), ['class' => 'form-control', 'prompt' => Yii::t('app', 'PROMPT_STATUS')])], ['attribute' => 'created_by', 'value' => function ($model) {
    return isset($model->user) && $model->user ? $model->user->username : '******';
}], 'created_at:date', ['class' => 'yii\\grid\\ActionColumn']]]);
Pjax::end();
?>
Esempio n. 2
0
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a('添加', ['create'], ['class' => 'btn btn-success']);
?>
        <input type="button" class="btn btn-info" value="批量删除" id="MyButton" >
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\CheckboxColumn'], 'id', ['attribute' => 'class', 'value' => function ($model) {
    return \common\models\Labels::getLabel($model->class, "class");
}, 'filter' => Html::activeDropDownList($searchModel, 'class', Yii::$app->params['class'], ['class' => 'form-control', 'prompt' => Yii::t('app', 'Please Filter')])], ['attribute' => 'course', 'value' => function ($model) {
    return \common\models\Labels::getLabel($model->course, "course");
}, 'filter' => Html::activeDropDownList($searchModel, 'course', Yii::$app->params['course'], ['class' => 'form-control', 'prompt' => Yii::t('app', 'Please Filter')])], 'title', 'thumb', 'keyword', ['attribute' => 'status', 'format' => 'html', 'value' => function ($model) {
    if ($model->status === Status::STATUS_ACTIVE) {
        $class = 'label-success';
    } elseif ($model->status === Status::STATUS_DELETED) {
        $class = 'label-warning';
    } else {
        $class = 'label-danger';
    }
    return '<span class="label ' . $class . '">' . Status::labels($model->status) . '</span>';
}, 'filter' => Html::activeDropDownList($searchModel, 'status', Status::labels(), ['class' => 'form-control', 'prompt' => Yii::t('app', 'PROMPT_STATUS')])], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
<?php 
$url = Yii::$app->urlManager->createUrl(['video/delete-multiple']);
Esempio n. 3
0
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\Pinglun */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => '评论管理', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="pinglun-view">

    <p>
        <?php 
echo Html::a('修改', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::a('删除', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => '确定要删除吗?', 'method' => 'post']]);
?>
    </p>

    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'star', 'content:ntext', ['attribute' => 'type', 'value' => \common\models\Labels::getLabel($model->type, "type")], 'rid', ['attribute' => 'created_by', 'value' => isset($model->user) && $model->user ? $model->user->username : "******"], 'created_at:datetime', 'updated_at:datetime']]);
?>

</div>
Esempio n. 4
0
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\Resource */
$this->title = $model->title;
$this->params['breadcrumbs'][] = ['label' => '学习资料管理', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="resource-view">

    <p>
        <?php 
echo Html::a('修改', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::a('删除', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => '确定要删除吗?', 'method' => 'post']]);
?>
    </p>

    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', ['attribute' => 'type', 'value' => \common\models\Labels::getLabel($model->type, "resource")], ['attribute' => 'class', 'value' => \common\models\Labels::getLabel($model->class, "class")], ['attribute' => 'course', 'value' => \common\models\Labels::getLabel($model->course, "course")], 'title', 'thumb', 'keyword', 'content:ntext', 'author', ['attribute' => 'status', 'value' => \common\models\Status::labels($model->status)], 'views', 'downtime:datetime', 'star', 'pinglunnum', 'created_at:datetime', 'updated_at:datetime']]);
?>

</div>