Blame view

doc/dev/modules/models/behaviors/imageUpload.php 573 Bytes
d1f8bd40   Alexey Boroda   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  <?php
  
  /**
  use thread\actions\fileapi\UploadBehavior;
  
  public function behaviors()
  {
      $module = Yii::$app->getModule('faq');
      $path = $module->getArticleUploadPath();
      $url = $module->getArticleUploadPath();
  
      return ArrayHelper::merge(parent::behaviors(), [
          'uploadBehavior' => [
              'class' => UploadBehavior::class,
              'attributes' => [
                  'image_link' => [
                      'path' => $path,
                      'url' => Yii::$app->getRequest()->BaseUrl . $url
                  ]
              ]
          ],
      ]);
  }
   */