Example #1
0
 public function getFormField($form, $fieldClass = null, array $extra = [])
 {
     if (!empty($this->types)) {
         $types = [];
         foreach ($this->types as $type) {
             $types[] = FileHelper::getMimeTypeByExtension($type);
         }
         $extra = array_merge($extra, ['html' => ['accept' => implode('|', $types)]]);
     }
     return parent::getFormField($form, FormFileField::className(), $extra);
 }