Beispiel #1
0
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model app\models\Activity */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => '活动管理', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="activity-view">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <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' => 'Are you sure you want to delete this item?', 'method' => 'post']]);
?>
    </p>

    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'name', ['attribute' => 'category', 'label' => '分类', 'value' => app\models\Train::getCategoryName($model->category)], ['attribute' => 'level_id', 'label' => '分类', 'value' => app\models\Level::getOneLevelNameById($model->level_id)], 'recruit_count', 'sign_up_begin_time', 'sign_up_end_time', 'begin_time', 'end_time', ['attribute' => 'status', 'label' => '状态', 'value' => app\models\Train::getStatusName($model->status)], 'content:ntext', 'lesson', 'score', 'address', 'bus', 'near_site', 'launch', 'organizers', 'join_teams', 'create_time', 'create_user', 'update_time', 'update_user']]);
?>

</div>
Beispiel #2
0
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="activity-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a('创建活动', ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'name', ['attribute' => 'category', 'value' => function ($searchModel) {
    return app\models\Train::getCategoryName($searchModel->category);
}], ['attribute' => 'level_id', 'value' => function ($searchModel) {
    return app\models\Level::getOneLevelNameById($searchModel->level_id);
}], 'recruit_count', ['label' => '管理', 'format' => 'html', 'value' => function ($searchModel) {
    $url = Html::a('参与教练', ['Admin/activity-users', 'ActivityUsersSearch[activity_id]' => $searchModel->id]);
    return $url;
}], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>