A small issue about extends
I install the codeigniter-restserver and it works. But when i want to use it in other project,it does not work. The two project is binded and includes PC web , mobile Web. In mobile Web CI project, class MY_Ucenter extends REST_Controller, it does not work. The chrome console says, 404 (Not Found). If class MY_Ucenter extends CI_COntroller,it works. In PC Web ,things are quite normal. I want to know, is my install error or extends error?
Hard to say without code examples. Did you create the functions in the controller like
function methodname_get()
{
// Do some stuff
}
?
Important is the _get
In my API interface project, as like this code, `public function del_post() { $ids = $this->input->post("ids"); if (!is_array($ids)) { $this->return_err("type error"); } else { $this->load->model("cart_model", "cart_model"); $res = $this->cart_model->del($ids, array("account_id" => $this->account["mid"])); if ($res) { $this->return_ok(array(), "success"); } else { $this->return_err("something wrong"); } } }' I want send data with AJAX, the AJAX url can be wrote "https://domain.com/api/index.php/cart/del";
But in my normal mobile project, if i want to send the same data, i must write the AJAX url like "https://domain.com/index.php/cart/del_post";
By the way,I can't install the codeigniter-restserver only by author's document in my mobile project.Anyone has the more details? Thank you
Sorry if im asking.
Your problem is, that you have to call the url with the index.php and you cant accesss it without index.php?
If that is your problem then its a server configuration problem. If not, try to explain the problems in a other way for me please.
I want send data with AJAX, the AJAX url can be wrote "https://domain.com/api/index.php/cart/del"; But in my normal mobile project, if i want to send the same data, i must write the AJAX url like "https://domain.com/index.php/cart/del_post";
Based on this I think he is still extending CI_Controller not REST_Controller.