There are methods that will perform the Ajax request. The question is how to properly close access to such methods if they are not directly accessed via the Ajax? So far, of course, just checking what kind of request I am doing, but I would like to hear how to properly close access to such methods.
public function remove_holiday(){ if(!$this->input->is_ajax_request()){ echo 'Not ajax request'; }else{ $id = $this->input->post('id'); $result = $this->my_model->delete('holidays', array('id' => $id)); if($result){ echo json_encode(true); } } }