Question about (extending) Controllers |
[eluser]smilie[/eluser]
Hi all! This is (most) probably a pure PHP question and not so much CI related. I am however stuck and would appreciate some help from you Oke, here we go (in steps): 1. Clean CI installation; 2. In a new Application directory placed: Code: abstract class CORE_Controller extends CI_Controller { ... } 3. Added REST Controller in the CI Core directory under libraries > Cpin2_rest.php: Code: class Cpin2_rest extends CI_Controller { ... } The problem. Ion Auth library is getting an instance of CI in constuctor with: $this->ci =& get_instance(); Then, in function logged_in() it does: Code: return (bool) $this->ci->session->userdata($identity); However, this produces error which states that 'session' is not known. If I do: Code: echo '<pre>'; print_r($this->ci); echo '</pre>'; exit; So - where did I took a wrong turn and is Rest controller now primary controller? Thanx! Cheers, Smilie
[eluser]smilie[/eluser]
Found it, after a lot of debugging The order of loading libraries was incorrect whereby Cpin2_rest overtook $this instance
[eluser]Konfine[/eluser]
Just a quick thing from me: $this->ci =& get_instance(); should be: $this->ci = get_instance(); http://forrst.com/posts/CodeIgniter_and_...rences-tao |
Welcome Guest, Not a member yet? Register Sign In |