+2 votes
in FuelPHP by
How to check an Ajax request on the server?

1 Answer

0 votes
by

Checking an Ajax request on the server is a task which can be done with the help of input class method. If there has been an Ajax request on the server, then the function, Input::is_ajax will return true, and in the otherwise case, it will return false.

Example

                                                    

if (Input::is_ajax()) {
    // Ajax request
} else {
    // Normal request
}

...