Problem with RESTFul and CI_Controller - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Problem with RESTFul and CI_Controller (/showthread.php?tid=39616) |
Problem with RESTFul and CI_Controller - El Forum - 03-16-2011 [eluser]smilie[/eluser] Hi all, I have a quite strange problem here and after spending quite a lot of time - I am still no closer to solution Any help is appreciated. Oke, to give you clear view / idea, this is the concept: Server 1: CI application with RESTFul client; Server 2: CI application with RestFul server. On server 1 I have one controller which initiates RESTFul and calls 'api' on the server 2. So far, no problems. On server 2, API receives the params (_post) and calls the model to do some DB queries. Problem occurs here. Model is loaded, but when I try to execute it - it fails. Here is the code: Server 1 Code: class Login extends CPIN_Controller Server 2 (API): Code: # Load the REST Api Problem is, on this line: Code: $result = $this->mam->get_page_text($this->input->post('page_id'),$this->input->post('website_id'),$this->input->post('lang_id')); It says: Quote:Severity: Notice If I do: Code: echo '<pre>';print_r($this); echo '</pre>'; exit; I get: Mam_api Object ( ... * a lot of params (array values) here ) But import one is at the end, which says: Code: [mam] => Mam Object So - what the hell am I doing wrong here Thanx! Problem with RESTFul and CI_Controller - El Forum - 03-16-2011 [eluser]smilie[/eluser] Small update; If I put: $mam = new Mam(); and then call: $result = $mam->get_page_text($this->input->post('page_id'),$this->input->post('website_id'),$this->input->post('lang_id')); Then it is working. But, imho - this should not be necessary Any help is appreciated. |