Hi there,
is there possible (if so, how to write it) to declare one variable for two (or more) upload fields ? Sorry if naming is wrong, I'm not a programmer.
For example, something like that:
$fields->addFieldToTab('Root.Download Area', $BulkFilesFirst = UploadField::create('First'));
$fields->addFieldToTab('Root.Download Area', $BulkFilesSecond = UploadField::create('Second'));
$BulkFilesFirst->setFolderName('some folder');
$BulkFilesFirst->getValidator()->setAllowedExtensions(array('pdf', 'zip'));
$BulkFilesSecond->setFolderName('some folder');
$BulkFilesSecond->getValidator()->setAllowedExtensions(array('pdf', 'zip'));
into:
$fields->addFieldToTab('Root.Download Area', $BulkFiles = UploadField::create('First'));
$fields->addFieldToTab('Root.Download Area', $BulkFiles = UploadField::create('Second'));
$BulkFiles->setFolderName('some folder');
$BulkFiles->getValidator()->setAllowedExtensions(array('pdf', 'zip'));
I know that code wouldn't work as I want (but you get the idea). Any help would be appreciated.
Thanks for your time,
Darek.