/** * Create a new file field. * * @param string $name The internal field name, passed to forms. * @param string $title The field label. * @param int $value The value of the field. */ public function __construct($name, $title = null, $value = null) { $this->upload = Upload::create(); parent::__construct($name, $title, $value); }
/** * @return Upload */ protected function getUpload() { $upload = Upload::create(); $upload->getValidator()->setAllowedExtensions(array_filter(File::config()->get('allowed_extensions'))); return $upload; }