-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow upload multiple #1380
Allow upload multiple #1380
Conversation
src/Form/Control/Upload.php
Outdated
$files[] = $_FILES[$k]; | ||
} | ||
|
||
if (count($files) > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remains for 1 file only like before and the whole control component
$img->onUpload(function ($files) use ($form, $img) { | ||
if ($files === 'error') { | ||
$img->onUpload(function ($postFile) use ($form, $img) { | ||
if ($postFile['error'] !== 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we pass now in native php FILES format, also if error
0daeebd
to
87ba48c
Compare
77feaa9
to
9f5bf52
Compare
9f5bf52
to
20e2a28
Compare
$fileName = $_POST['f_name'] ?? null; | ||
$this->cb->set(function () use ($fx, $fileName) { | ||
$this->addJsAction($fx($fileName)); | ||
$this->hasUploadCb = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$this->hasUploadFx ?
But only if we can refactor $this->cb to $this->fx (BC)
To keep all naming consistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is related with Callback, lets fix this in #1377
this PR adds support to multiple files to be uploaded, but only uploaded - the Upload control still remains for one file only
original fx signatures remains - now only more files can be passed
marking as BC breaks as no special "error" string param is passed anymore