echo $form->field($model, 'jiangli')->widget(\yii\imperavi\Widget::className(), ['plugins' => ['fullscreen', 'fontcolor', 'video', 'fontsize'], 'options' => ['lang' => 'zh', 'minHeight' => 150, 'maxHeight' => 400, 'buttonSource' => true, 'convertDivs' => false, 'removeEmptyTags' => false, 'imageUpload' => Yii::$app->urlManager->createUrl(['/file-storage/upload-imperavi'])]]); ?> <?php echo $form->field($model, 'jiangli_fangfa')->widget(\yii\imperavi\Widget::className(), ['plugins' => ['fullscreen', 'fontcolor', 'video', 'fontsize'], 'options' => ['lang' => 'zh', 'minHeight' => 150, 'maxHeight' => 400, 'buttonSource' => true, 'convertDivs' => false, 'removeEmptyTags' => false, 'imageUpload' => Yii::$app->urlManager->createUrl(['/file-storage/upload-imperavi'])]]); ?> <?php echo $form->field($model, 'content')->widget(\yii\imperavi\Widget::className(), ['plugins' => ['fullscreen', 'fontcolor', 'video', 'fontsize'], 'options' => ['lang' => 'zh', 'minHeight' => 600, 'maxHeight' => 800, 'buttonSource' => true, 'convertDivs' => false, 'removeEmptyTags' => false, 'imageUpload' => Yii::$app->urlManager->createUrl(['/file-storage/upload-imperavi'])]]); ?> <?php echo $form->field($model, 'sort'); ?> <?php echo $form->field($model, 'status')->dropDownList(Activity::getStatus()); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?> </div>
<?php use yii\helpers\Html; use yii\helpers\ArrayHelper; use yii\widgets\DetailView; use common\models\Activity; /* @var $this yii\web\View */ /* @var $model common\models\Activity */ $this->title = $model->title; $this->params['breadcrumbs'][] = ['label' => Yii::t('common', 'Activity'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="activity-view"> <p> <?php echo Html::a(Yii::t('backend', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']); ?> <?php echo Html::a(Yii::t('backend', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Yii::t('backend', 'Are you sure you want to delete this item?'), 'method' => 'post']]); ?> </p> <?php echo DetailView::widget(['model' => $model, 'attributes' => [['attribute' => 'category_id', 'value' => $model->category->title], ['attribute' => 'relation_game_id', 'value' => $model->game->name], 'title', 'description:ntext', 'url:url', 'start_time:datetime', 'end_time:datetime', 'guize:html', 'jiangli:html', 'jiangli_fangfa:html', ['attribute' => 'thumbnail', 'format' => 'html', 'value' => Html::img($model->getThumbnailUrl(), ['class' => 'img-responsive'])], ['attribute' => 'bg_image', 'format' => 'html', 'value' => Html::img($model->getBgUrl(), ['class' => 'img-responsive'])], 'content:html', 'slug', 'created_at:datetime', 'updated_at:datetime', ['attribute' => 'status', 'value' => ArrayHelper::getValue(Activity::getStatus(), $model->status)]]]); ?> </div>
use yii\helpers\ArrayHelper; use yii\grid\GridView; use common\models\Activity; /* @var $this yii\web\View */ /* @var $searchModel backend\models\search\ActivitySearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Yii::t('common', 'Activity'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="activity-index"> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <p> <?php echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => Yii::t('common', 'Activity')]), ['create'], ['class' => 'btn btn-success']); ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'category_id', 'value' => function ($model) { return $model->category ? $model->category->title : null; }, 'filter' => ArrayHelper::map(\common\models\ActivityCategory::find()->all(), 'id', 'title')], 'title', 'start_time:datetime', 'end_time:datetime', ['attribute' => 'thumbnail', 'format' => 'html', 'value' => function ($model) { return Html::img($model->getThumbnailUrl(), ['class' => 'img-responsive', 'styles' => 'width:100px;']); }], ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => Activity::getStatus()], 'sort', ['class' => 'yii\\grid\\ActionColumn']], 'layout' => "{items}\n{summary}\n{pager}"]); ?> </div>