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

[Router] Update the request object with parameters of the route #143

Closed
wants to merge 1 commit into from

Conversation

vincentdieltiens
Copy link
Contributor

Update the Url QueryString of the request object with the parameters return by the UrlMatcher to let the developer access thoses parameters.

The user can simply access the parameters via the Query String of the request object :

public function onOpen(ConnectionInterface $conn) {
    print_r($conn->WebSocket->request->getQuery());
}

fixes #141

…rameters return by the UrlMatcher to let the developer access thoses parameters
@cboden
Copy link
Member

cboden commented Nov 12, 2013

cool! Would you mind adding a unit test to RouterTest before I merge this please?

@vincentdieltiens
Copy link
Contributor Author

Ok, I will try to do that ASAP :)

@cboden
Copy link
Member

cboden commented Feb 2, 2014

Any chance of that unit test incoming @vincentdieltiens? :)

@vincentdieltiens
Copy link
Contributor Author

You're right ! I still do that. I put it in top of my TODO list ;-)

@cboden cboden added this to the 0.3.1 milestone Feb 6, 2014
@cboden cboden added HTTP and removed WebSocket labels Feb 6, 2014

$parameters = array();
foreach($route as $key => $value) {
if (!in_array($key, array('_controller', '_route'))) {
Copy link
Member

Choose a reason for hiding this comment

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

Should probably also add _format and _local I think. Or perhaps just ignore all starting with a _?

This was referenced Mar 18, 2014
@cboden
Copy link
Member

cboden commented Mar 30, 2014

Changes merged in with updated PR #175

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Router Symfony Parameters
2 participants