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

Tag::linkTo() to allow the addition of query string parameters #2002

Closed
kolypto opened this issue Feb 9, 2014 · 2 comments
Closed

Tag::linkTo() to allow the addition of query string parameters #2002

kolypto opened this issue Feb 9, 2014 · 2 comments

Comments

@kolypto
Copy link

kolypto commented Feb 9, 2014

Tag::linkTo() should allow to add query-string parameters

@Jeckerson
Copy link
Member

You can do it like that

$query = http_build_query(array('a' => 1, 'b' => 2));
Tag::linkTo('controller?'.$query, 'Link name');

But there are some kind of issue, because it use htmlentities() function and output will be:

<a href="/controller?a&#x3d;1&#x26;b&#x3d;2">Link name</a>

It works anyway, but does it correct?

@kolypto
Copy link
Author

kolypto commented Feb 9, 2014

Yes, but not with named routes:

{{ link_to([ 'for': 'dashboard' ], 'Dashboard') }}

so need a generic solution

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

No branches or pull requests

3 participants