CodeIgniter Forums
post is non-object - 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: post is non-object (/showthread.php?tid=8864)



post is non-object - El Forum - 06-03-2008

[eluser]louis w[/eluser]
I have two methods in the same controller. Listed right after each other:
Code:
protected function _set_input() {
        $this->input = ($this->input->post('input')) ? $this->input->post('input') : $this->input->get('input');
}
protected function _set_mode() {
        $this->input = ($this->input->post('mode')) ? $this->input->post('mode') : $this->input->get('mode');
}

They are both being called the same way
Code:
$this->_set_input();
$this->_set_mode();

Now here is where it gets weird. It errors on the second one saying
Fatal error: Call to a member function post() on a non-object in ...

If i comment out the first one, it works thou. Seems as if the second time you check the input->post it will trigger the non-object error.

Any idea what this might be?