Esempio n. 1
0
 public function setUp()
 {
     parent::setUp();
     $this->migrationPath = realpath(__DIR__ . '/../../protected/migration');
     if (is_dir($this->migrationPath)) {
         File::removeDirectory($this->migrationPath);
     }
     mkdir($this->migrationPath, 0777, true);
     $this->m = new Migration(new Test(), $this->migrationPath);
 }
Esempio n. 2
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);
 }