extending controllers - 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: extending controllers (/showthread.php?tid=13534) |
extending controllers - El Forum - 11-26-2008 [eluser]dimis[/eluser] I have a site with the front end and the back end. I want to create 2 controllers that will extend the core controller (MY_Frontcontroller,MY_Backcontroller) and the controllers of front end and back end to extend them. Can I do this, to make 2 separate classes that extend one core class and then extends them at my controllers? extending controllers - El Forum - 11-26-2008 [eluser]Sarfaraz Momin[/eluser] you can create a My_controller library which would extend the controller class and then in that you can create 2 seperate classes which would be for public and private access. Something like this : Code: class Public_Controller extends Controller { extending controllers - El Forum - 02-16-2009 [eluser]Dimitrio[/eluser] Quote:if ($this->data->user === FALSE) { I am very new to CI, can someone please explain to me what the "$this->data->user" is, and where CI gets it from, as well as the "header". I am trying to use erkana auth to only show a menu in my Header_view if the person is logged in, but I keep on getting errors, I think I might be able to solve it once I understand these two concepts. Thnx extending controllers - El Forum - 02-16-2009 [eluser]TheFuzzy0ne[/eluser] $this->data->user has nothing to do with CI. That is a property that belongs to the auth library itself. The header() call redirects the user to the login page if they aren't logged in. extending controllers - El Forum - 02-16-2009 [eluser]Dimitrio[/eluser] Thank you for clearing that up. I think I am going to drop that and just load an extra view "Menu_view" when the person logs in. |