CodeIgniter Forums
Login box on a page - 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: Login box on a page (/showthread.php?tid=22981)



Login box on a page - El Forum - 09-25-2009

[eluser]Unknown[/eluser]
I'm just getting into CodeIgniter and have a question about how to do a login box. I know how to program a login box but I'm wondering how I should do it with codeigniter.

Say I have a controller and view for my homepage. On that homepage I want a login box in the left hand column. Where would I put the code for this login box. It could potentially be on a number of pages, not just the homepage so putting it in the homepage controller doesn't make sense.

Seems like I should create a separate controller for the login box. Then how would I call that controller from the homepage controller.

Any help to get me going in the right direction would be great.
thanks


Login box on a page - El Forum - 09-25-2009

[eluser]jedd[/eluser]
Hi samtherobot and welcome to the CI forums.

I think [url="http://codeigniter.com/wiki/Header_and_footer_and_menu_on_every_page/"]this page[/url] in the wiki might be helpful - have a read and let me know if that makes sense.

Extending MY_Controller is a very useful thing to do (and nicely documented in the guide) for a range of problems like this.