Blame view

common/modules/artboxfile/models/File.php 651 Bytes
4253cbec   root   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
25
26
27
28
29
30
31
32
33
34
  <?php
  
  namespace common\modules\artboxfile\models;
  
  use Yii;
  use yii\db\ActiveRecord;
  
  class File extends ActiveRecord {
  
      public $fileUploadName;
  
      /**
       * @inheritdoc
       */
      public function rules()
      {
          return [
              [['file'], 'string', 'max' => 255],
              [[$this->fileUploadName], 'safe'],
              [[$this->fileUploadName], 'file', 'extensions' => 'jpg, gif, png'],
          ];
      }
  
      /**
       * @inheritdoc
       */
      public function attributeLabels()
      {
          return [
              'file' => Yii::t('artbox', 'File name'),
              'fileUpload' => Yii::t('artbox', 'File'),
          ];
      }
  }