use yii\helpers\Html; use yii\widgets\DetailView; /* @var $this yii\web\View */ /* @var $model bariew\postModule\models\Category */ $this->title = $model->title; $this->params['breadcrumbs'][] = ['label' => Yii::t('modules/post', 'Categories'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="category-view"> <h1><?php echo Html::encode($this->title); ?> </h1> <p> <?php echo Html::a(Yii::t('modules/post', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']); ?> <?php echo Html::a(Yii::t('modules/post', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Yii::t('modules/post', 'Are you sure you want to delete this item?'), 'method' => 'post']]); ?> </p> <?php echo DetailView::widget(['model' => $model, 'attributes' => [['attribute' => 'image', 'format' => 'raw', 'value' => \bariew\postModule\widgets\ImageGallery::widget(['model' => $model, 'field' => 'thumb1'])], 'id', 'title', 'name', 'content:ntext', 'is_active']]); ?> </div>
/* @var $this yii\web\View */ /* @var $model bariew\postModule\models\Item */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="item-form"> <?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?> <?php echo $form->field($model, 'image[]')->fileInput(['multiple' => true]); ?> <?php echo \bariew\postModule\widgets\ImageGallery::widget(['model' => $model, 'field' => 'thumb1']); ?> <?php echo $form->field($model, 'title')->textInput(['maxlength' => 255]); ?> <div class="form-group required"> <?php echo yii\imperavi\Widget::widget(['model' => $model, 'attribute' => 'brief', 'options' => ['minHeight' => 100, 'fileUpload' => Url::toRoute(['file-upload', 'attr' => 'brief', 'id' => $model->id]), 'imageUpload' => Url::toRoute(['image-upload', 'attr' => 'brief', 'id' => $model->id]), 'imageGetJson' => Url::toRoute(['image-list', 'attr' => 'brief', 'id' => $model->id]), 'imageUploadErrorCallback' => new \yii\web\JsExpression('function(json) { alert(json.error); }'), 'fileUploadErrorCallback' => new \yii\web\JsExpression('function(json) { alert(json.error); }')]]); ?> <?php if ($model->hasErrors('content')) { ?> <div class="has-error"> <?php echo \yii\helpers\Html::error($model, 'brief', $form->field($model, 'brief')->errorOptions);
use yii\helpers\Html; use yii\widgets\DetailView; /* @var $this yii\web\View */ /* @var $model bariew\postModule\models\Item */ $this->title = $model->title; $this->params['breadcrumbs'][] = ['label' => Yii::t('modules/post', 'Items'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="item-view"> <h1><?php echo Html::encode($this->title); ?> </h1> <p> <?php echo Html::a(Yii::t('modules/post', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']); ?> <?php echo Html::a(Yii::t('modules/post', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Yii::t('modules/post', 'Are you sure you want to delete this item?'), 'method' => 'post']]); ?> </p> <?php echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'user_id', 'title', 'brief:ntext', 'content:ntext', 'is_active', 'created_at:datetime', ['attribute' => 'image', 'format' => 'raw', 'value' => \bariew\postModule\widgets\ImageGallery::widget(['model' => $model, 'field' => 'thumb1'])]]]); ?> </div>