Aura\Router with HTTP GET params

29 views
Skip to first unread message

Chris Johnson

unread,
Jun 28, 2017, 11:34:45 PM6/28/17
to The Aura Project for PHP
How do I set up path matching and parameter handling (token matching) for an HTTP GET request with a path like:
/my-callback?term=abc123

I'm using a jQuery plugin which unfortunately requires that kind of request path for an AJAX callback, instead of the friendlier:
/my-callback/term/abc123

Which is easy to handle.

Hari K T

unread,
Jun 29, 2017, 12:53:25 AM6/29/17
to aur...@googlegroups.com
There can be other ways. Currently this can be achieved via a custom rule.

1 ) Two routes are defined
  a ) /my-callback
  b ) /my-callback/term/{id}
2 ) Then you write a custom rule.


In the rule you can look if there is a term in the get request and return true if found. Else return false for the route to fail.

The handler for both routes will be same. 

Does that help to make this possible ?

I fear if there is more problems you may face in building the same.

Hari K T

You can ring me : +91 9388 75 8821

Skype  : kthari85
Twitter : harikt

--
You received this message because you are subscribed to the Google Groups "The Aura Project for PHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to auraphp+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Johnson

unread,
Jun 29, 2017, 6:01:55 PM6/29/17
to The Aura Project for PHP
Thank you, Hari K T!
To unsubscribe from this group and stop receiving emails from it, send an email to auraphp+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages