private function addBehavior()
 {
     $this->attachBehaviors(['file' => ['class' => \metalguardian\fileProcessor\behaviors\UploadBehavior::className(), 'attribute' => '[' . $this->language . ']value', 'validator' => ['extensions' => ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'txt', 'png', 'gif', 'jpg', 'jpeg'], 'on' => ['file', 'image']], 'required' => false]]);
 }
Beispiel #2
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return \yii\helpers\ArrayHelper::merge(parent::behaviors(), ['file' => ['class' => \metalguardian\fileProcessor\behaviors\UploadBehavior::className(), 'attribute' => 'value', 'validator' => ['extensions' => ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'txt', 'png', 'gif', 'jpg', 'jpeg'], 'on' => ['file', 'image']], 'required' => true]]);
 }