8000 All route variables from the current route... · Issue #12901 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

All route variables from the current route... #12901

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

Closed
RubenHarms opened this issue Dec 8, 2014 · 5 comments
Closed

All route variables from the current route... #12901

RubenHarms opened this issue Dec 8, 2014 · 5 comments

Comments

@RubenHarms
Copy link

Is there a short way to get all router parameters (including the query parameters)?

Now i use the following code:

$routeVars = array_merge($this->getRequest()->query->all(), $this->getRequest()->attributes->get('_route_params'));        
@weaverryan
Copy link
Member

I think what you're already doing is the perfect way. There's no direct way because I don't think this is a generally needed thing. The Request's get() method is similar, but it goes through query, all attributes and I believe also the post params - so it's not exactly the same (and it only allows you to fetch a given key, not retrieve a big array).

Cheers!

@peterrehm
Copy link
Contributor

Looks fine, you can simplify this in your application.

@Tobion
Copy link
Contributor
Tobion commented Dec 9, 2014

Use-case probably related to #3965

@RubenHarms
Copy link
Author

@Tobion You are right. You already suggest the function i miss. I see the issue is still open! What happends?

@Tobion
Copy link
Contributor
Tobion commented Dec 10, 2014

See #3965 (comment)
Closing as duplicate.

@Tobion Tobion closed this as completed Dec 10, 2014
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

4 participants
0