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

[NFR] Allow Phalcon\Mvc\Url::get() to append query params #877

Merged
merged 4 commits into from Jul 22, 2013
Merged

[NFR] Allow Phalcon\Mvc\Url::get() to append query params #877

merged 4 commits into from Jul 22, 2013

Conversation

ghost
Copy link

@ghost ghost commented Jul 18, 2013

See #723

The only difference is that query parameters are passed as the optional second argument (can be either an array or object).

@ghost
Copy link
Author

ghost commented Jul 22, 2013

Rebased against the latest HEAD

phalcon pushed a commit that referenced this pull request Jul 22, 2013
[NFR] Allow Phalcon\Mvc\Url::get() to append query params
@phalcon phalcon merged commit 4d3e5db into phalcon:1.2.1 Jul 22, 2013
@ghost ghost deleted the issue-723 branch July 22, 2013 15:49
@jeffreycahyono
Copy link

Usage example pls?

@ghost
Copy link
Author

ghost commented Jul 23, 2013

$url = new Phalcon\Mvc\Url();
echo $url->get('', array('a' => 1, 'b' => array(2, 3, 4, 5))), "\n";

will produce /?a=1&b%5B0%5D=2&b%5B1%5D=3&b%5B2%5D=4&b%5B3%5D=5

$url = new Phalcon\Mvc\Url();
echo $url->get('test?x=1', array('a' => 1, 'b' => array(2, 3, 4, 5))), "\n";

will produce /test?x=1&a=1&b%5B0%5D=2&b%5B1%5D=3&b%5B2%5D=4&b%5B3%5D=5.

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.

3 participants