You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.
I want to submit a nice request ( i think )
For now in methods we have:
GET POST etc... i want to be added one more "XHR" or "Ajax" and this one can be accepted only ajax requests.
Now my controllers with ajax must be like this:
if(parent::is_ajax()) {
//my code
}
is_ajax function is:
public function is_ajax() {
return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
}
In my opinion AJAX cannot be a HTTP Method, since you can use any of POST,GET,DELETE,PUT,... method in your ajax call, PHP-Router would not be able to distinguish POST or DELETE for example.
I think AJAX should be included in another set of caller constraint, wich could be :
I want to submit a nice request ( i think )
For now in methods we have:
GET POST etc... i want to be added one more "XHR" or "Ajax" and this one can be accepted only ajax requests.
Now my controllers with ajax must be like this:
is_ajax function is:
I need this to be added and my routers will be:
instead
is this possible ?
The text was updated successfully, but these errors were encountered: