-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[FilesCollection] Allow getFiles with dot syntax #357
Conversation
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.
Looking great so far. Thanks for digging into this!
I only had a comment on the docs portion, then I'll be happy to merge.
$file = $this->request->getFile('avatar'); | ||
|
||
.. note:: This currently only works with simple file names and not with array syntax naming. | ||
$file = $this->request->getFile('my-form.details.avatar.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.
A couple of things:
- We should still show that you can access the simple case
$this->request->getFile('avatar');
. - If there are multiple files with the same name, then your example applies, but what if there's only one file with a deep name? Basically - we should show all three methods in the docs.
// Get a single file
$file = $this->request->getFile('avatar');
// Get a single file within a more complex path
$file = $this->request->getFile('my-form.details.avatar');
// Get the first of several files uploaded under the same name
$file = $this->request->getFile('my-form.details.avatar.0');
Looking at the code, I believe those cases will all pass currently, and we need them to. :)
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.
Hi @lonnieezell Thanks!
Sorry for the brevity in the User Guide. My English is very poor. In the next few days I will write some examples
Hi @lonnieezell Done! I have written some examples. If necessary can you correct the user guide? Thanks! |
Looks good. Thanks! Merging. |
[FilesCollection] Allow getFiles with dot syntax. Fix #112