Ejemplo n.º 1
0
 public function imageForm()
 {
     ImageFieldAsset::register(\Yii::$app->view);
     CropperAsset::register(\Yii::$app->view);
     $content = '';
     if ($this->images) {
         foreach ($this->images as $image) {
             $content .= \Yii::$app->view->renderFile('@vendor/floor12/yii2-imagefield/views/_form.php', ['image' => $image, 'class' => \yii\helpers\StringHelper::basename(get_class($this->owner))]);
         }
     }
     return \Yii::$app->view->renderFile('@vendor/floor12/yii2-imagefield/views/form.php', ['images' => $content, 'className' => \yii\helpers\StringHelper::basename(get_class($this->owner))]);
 }
 public function singleImageForm($field)
 {
     SimpleImageFieldAsset::register(\Yii::$app->view);
     CropperAsset::register(\Yii::$app->view);
     return \Yii::$app->view->renderFile('@vendor/floor12/yii2-imagefield/views/singleForm.php', ['attributeName' => $this->fields[$field], 'field' => $field, 'image' => $this->singleImage[$field], 'classname' => $this->owner->classname(), 'class' => \yii\helpers\StringHelper::basename(get_class($this->owner))]);
 }