Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does request::is_ajax() work in Kohana?

Tags:

ajax

php

kohana

How does Kohana determine if a request is an AJAX one?

Is there anything different in the referrer string? Do I need to add a GET param, perhaps ?ajax=true ?

like image 467
alex Avatar asked Dec 10 '22 20:12

alex


1 Answers

It checks if the request is made by XMLHttpRequest since most browser send a header in this case with this indication: header HTTP_X_REQUESTED_WITH would be set to XMLHttpRequest.

like image 89
txwikinger Avatar answered Dec 13 '22 23:12

txwikinger