Created
February 19, 2013 06:23
-
-
Save siteslave/4983558 to your computer and use it in GitHub Desktop.
การตรวจสอบ Request ว่าเป็น Ajax หรือไม่
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Products extends CI_Controller | |
{ | |
public function __construct() | |
{ | |
parent::__construct(); | |
} | |
public function get_list() | |
{ | |
$is_ajax = $this->input->is_ajax_request(); | |
if($is_ajax) | |
{ | |
echo '{"success": true}'; | |
} | |
else | |
{ | |
show_error('Not ajax.', 404); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment