use yii\helpers\Html; use zxbodya\yii2\galleryManager\GalleryManager; /* @var $this yii\web\View */ /* @var $model app\modules\gallery\models\Gallery */ $this->title = 'Update Gallery: ' . $model->name; $this->params['breadcrumbs'][] = ['label' => 'Galleries', 'url' => ['index']]; $this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]]; $this->params['breadcrumbs'][] = 'Update'; ?> <div class="gallery-update"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php echo $this->render('_form', ['model' => $model]); ?> <?php if ($model->isNewRecord) { echo 'Can not upload images for new record'; } else { echo GalleryManager::widget(['model' => $model, 'behaviorName' => 'galleryBehavior', 'apiRoute' => 'gallery/galleryApi']); } ?> </div>
<div class="form-group"> <div class="control-label"> <h3>Imágenes</h3> </div> <?php if ($model->isNewRecord) { ?> <div class="control-label">Se debe guardar el producto antes de subir imágenes</div> <?php } else { ?> <?php echo GalleryManager::widget(['model' => $model, 'behaviorName' => Product::GALLERY_IMAGE_BEHAVIOR, 'apiRoute' => 'gallery-api']); ?> <?php } ?> </div> <?php echo $form->field($model, 'description')->textarea(['rows' => 6]); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Crear' : 'Editar', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div>