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

feat: flatten nested array in $params #40

Merged
merged 2 commits into from
Apr 5, 2019
Merged

Conversation

sherwinski
Copy link
Contributor

@sherwinski sherwinski commented Apr 5, 2019

Certain imgix URL parameters accept multiple comma-separated values, eg auto=compress,format. This PR introduces support for multiple URL parameters by flattening nested arrays passed into $params, separating them by commas.

For example, the following scenario would previously throw an error:

$params = array("auto" => array("compress","format"));
$url = $builder->createURL("bridge.png", $params);

After flattening the array, it should now produce the following URL:

https://demos.imgix.net/bridge.png?auto=compress%2Cformat

Special thanks to @xuneXTW for catching this.

@sherwinski sherwinski changed the title fix: implode nested params fix: flatten nested array in $params Apr 5, 2019
Copy link

@nathan-heskia nathan-heskia left a comment

Choose a reason for hiding this comment

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

👍

@sherwinski sherwinski merged commit 229b4ce into master Apr 5, 2019
@sherwinski sherwinski deleted the implode-nested-params branch April 5, 2019 22:07
@sherwinski sherwinski changed the title fix: flatten nested array in $params feat: flatten nested array in $params Apr 8, 2019
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