IMPR: allow func.method_name calls for setUfConfig

Example:
$bulk = new BulkUploader();
$bulk->setUfSetup('getValidator.setAllowedExtensions', ['jpg', 'jpeg', 'png', 'gif']);
This commit is contained in:
Tony Air 2022-04-19 15:26:42 +02:00 committed by GitHub
parent 8341a46aed
commit fa699e3831
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -250,7 +250,15 @@ class BulkUploader implements GridField_HTMLProvider, GridField_URLHandler
//UploadField setup
foreach ($this->ufSetup as $fn => $param) {
$uploadField->{$fn}($param);
$funcs = explode('.', $fn);
$lastCall = array_pop($funcs);
$res = $uploadField;
foreach ($funcs as $call) {
$res = $res->{$call}();
}
$res->{$lastCall}($param);
}
$schema['data']['createFileEndpoint'] = [