/* @var $dataProvider yii\data\ActiveDataProvider */ ArtikelAsset::register($this); $this->title = 'Artikels'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="artikel-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <p> <?php echo Html::a('Create Artikel', ['create'], ['class' => 'btn btn-success']); ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'id', 'format' => 'raw', 'value' => function ($model) { return "#" . $model->id; }], 'judul', 'summary:ntext', 'schedule_date', ['attribute' => 'status', 'format' => 'raw', 'value' => function ($model) { return Artikel::getStatus($model->status); }], ['class' => 'yii\\grid\\ActionColumn']]]); ?> </div>
use backend\assets\ArtikelAsset; use backend\models\Artikel; /* @var $this yii\web\View */ /* @var $model backend\models\Artikel */ ArtikelAsset::register($this); $this->title = $model->judul; $this->params['breadcrumbs'][] = ['label' => 'Artikels', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="artikel-view"> <h1><?php echo Html::encode($this->title); ?> </h1> <p> <?php echo Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']); ?> <?php echo Html::a('Delete', ['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', 'judul', 'summary', 'deskripsi:ntext', 'author_name', 'categori_name', 'sumber', 'schedule_date', ['label' => 'Status', 'value' => Artikel::getStatus($model->status)], ['label' => 'Image File', 'type' => 'row', 'format' => ['image', ['width' => '150', 'height' => '100', 'alt' => $model->judul]], 'value' => !empty($model->image1) ? \Yii::$app->jurnalrumah->lihatImageDetail($model->image1, "", $kategori = "artikel") : NULL], ['label' => 'Image File 2', 'type' => 'row', 'format' => ['image', ['width' => '150', 'height' => '100', 'alt' => $model->judul]], 'value' => !empty($model->image2) ? \Yii::$app->jurnalrumah->lihatImageDetail($model->image2, "", $kategori = "artikel") : NULL], ['label' => 'Image File 3', 'type' => 'row', 'format' => ['image', ['width' => '150', 'height' => '100', 'alt' => $model->judul]], 'value' => !empty($model->image3) ? \Yii::$app->jurnalrumah->lihatImageDetail($model->image3, "", $kategori = "artikel") : NULL], ['label' => 'Image File 4', 'type' => 'row', 'format' => ['image', ['width' => '150', 'height' => '100', 'alt' => $model->judul]], 'value' => !empty($model->image4) ? \Yii::$app->jurnalrumah->lihatImageDetail($model->image4, "", $kategori = "artikel") : NULL], ['label' => 'Image File 5', 'type' => 'row', 'format' => ['image', ['width' => '150', 'height' => '100', 'alt' => $model->judul]], 'value' => !empty($model->image5) ? \Yii::$app->jurnalrumah->lihatImageDetail($model->image5, "", $kategori = "artikel") : NULL], ['label' => 'Image File 6', 'type' => 'row', 'format' => ['image', ['width' => '150', 'height' => '100', 'alt' => $model->judul]], 'value' => !empty($model->image6) ? \Yii::$app->jurnalrumah->lihatImageDetail($model->image6, "", $kategori = "artikel") : NULL], ['label' => 'Image File 7', 'type' => 'row', 'format' => ['image', ['width' => '150', 'height' => '100', 'alt' => $model->judul]], 'value' => !empty($model->image7) ? \Yii::$app->jurnalrumah->lihatImageDetail($model->image7, "", $kategori = "artikel") : NULL], ['label' => 'Image File 8', 'type' => 'row', 'format' => ['image', ['width' => '150', 'height' => '100', 'alt' => $model->judul]], 'value' => !empty($model->image8) ? \Yii::$app->jurnalrumah->lihatImageDetail($model->image8, "", $kategori = "artikel") : NULL], ['label' => 'Image File 9', 'type' => 'row', 'format' => ['image', ['width' => '150', 'height' => '100', 'alt' => $model->judul]], 'value' => !empty($model->image9) ? \Yii::$app->jurnalrumah->lihatImageDetail($model->image9, "", $kategori = "artikel") : NULL], 'video:ntext', 'date_create', 'date_update', 'tag']]); ?> </div>
<?php echo $form->field($model, 'schedule_date')->widget(DateTimePicker::className(), ['language' => 'en', 'size' => 'ms', 'template' => '{input}', 'pickButtonIcon' => 'glyphicon glyphicon-time', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-m-dd hh:ii', 'todayBtn' => true]]); ?> <?php echo Html::activeLabel($model, 'tag'); ?> <?php echo SelectizeTextInput::widget(['model' => $model->tag, 'name' => 'Artikel[tag]', 'id' => 'artikel-tag', 'value' => $model->isNewRecord ? '' : $model->tag, 'clientOptions' => ['plugins' => ['remove_button'], 'delimiter' => ',', 'persist' => false, 'create' => 'function(input){ return { value : input, text : input } }']]); ?> <?php echo $form->field($model, 'status', ['template' => "{label}{input}\n{hint}\n{error}"])->dropDownList(Artikel::getStatus(), ['prompt' => '-- Pilih --']); ?> <?php // $form->field($model, 'video')->textarea(['rows' => 6]) ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?>