Пример #1
0
 public function init()
 {
     parent::init();
     if (!isset($this->afterUploadHandler)) {
         $this->afterUploadHandler = [$this, 'afterUpload'];
     }
 }
Пример #2
0
 public function init()
 {
     parent::init();
     $this->upload = $this->upload . '/' . date('Ym');
     $this->uploadDir = Yii::getAlias('@frontend/web/' . $this->upload . '/');
     if (!file_exists($this->uploadDir)) {
         FileHelper::createDirectory($this->uploadDir);
     }
     $this->uploadSrc = Yii::getAlias('@web/' . $this->upload . '/');
     if (!isset($this->afterUploadHandler)) {
         $this->afterUploadHandler = [$this, 'afterUpload'];
     }
 }
Пример #3
0
 public function init()
 {
     parent::init();
     $this->upload = $this->upload . '/' . date('Ym');
     $this->uploadDir = Yii::getAlias('@wwwdir/' . $this->upload . '/');
     $this->newFileName = \common\components\Utils::fileName(5);
     if (!file_exists($this->uploadDir)) {
         FileHelper::createDirectory($this->uploadDir);
     }
     $this->uploadSrc = Yii::getAlias('/' . $this->upload . '/');
     if (!isset($this->afterUploadHandler)) {
         $this->afterUploadHandler = [$this, 'afterUpload'];
     }
 }