Skip to content
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

Merged
merged 6 commits into from
Jan 9, 2017
Merged

[FilesCollection] Allow getFiles with dot syntax #357

merged 6 commits into from
Jan 9, 2017

Conversation

davidgv88
Copy link
Contributor

[FilesCollection] Allow getFiles with dot syntax. Fix #112

Copy link
Member

@lonnieezell lonnieezell left a 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');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of things:

  1. We should still show that you can access the simple case $this->request->getFile('avatar');.
  2. 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. :)

Copy link
Contributor Author

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

@davidgv88
Copy link
Contributor Author

Hi @lonnieezell

Done! I have written some examples. If necessary can you correct the user guide?

Thanks!

@lonnieezell
Copy link
Member

Looks good. Thanks! Merging.

@lonnieezell lonnieezell merged commit 6c1abe3 into codeigniter4:develop Jan 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants