Welcome Guest, Not a member yet? Register   Sign In
Is there a way of detecting POST data in URL requests before routing them?
#5

[eluser]sorenchr[/eluser]
[quote author="Fabdrol" date="1296023360"]I think you could make this work with a hook, firing before the POST and GET data is sanitized.
Maybe you could do something like this:

- is $_POST populated?
- set a (global) variable $ajax_data to true
- set a (global) variable $ajax_method with the method name
- set a (global) variable $ajax_params with the parameters

then, in the routes.php file, you could set a dynamic route, something like this:
Code:
if($ajax_data) {
  $params = implode('/', $ajax_params);
  $route["$ajax_controller/$ajax_method"] = "ajax/$ajax_method/$params";
}

I've not tested it myself, but I suppose you could give it a shot...[/quote]

I guess this isn't going to be an easy one. Thanks for the help though.


Messages In This Thread
Is there a way of detecting POST data in URL requests before routing them? - by El Forum - 01-26-2011, 04:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB