0

I ask an API which redirects on my website with this URL:

http://localhost/#!/Test?code=e5854f28a9bd2940734t58f91a333662

In my controller I would like to catch "code" parameter like this:

<?php
$request = $this->get('request');
if($request->query->get('code'))
    echo 'ok';
else
    echo 'not ok';
?>

But there's nothing on $request->query... I suppose it's because I have no route with this format, but how can I force or get it? Or do I have to create a route?

1 Answer 1

4

Stuff after the hashbang is not processed by the server, so your $request object will be empty.

Hashbang routes should be handled by the client [Backbone.js, Angular.js, whatever], which should ask the server for proper [RESTful] resources, which will use regular URI schema.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.