Welcome Guest, Not a member yet? Register   Sign In
Common functions across multiple pages
#1

[eluser]Unknown[/eluser]
Hi there. Im am very new to CI the mvc model.
I have a question.

I have a simple page with is made of up 3 views. Header, Content and Footer.
Now content will be unique across the site but header and footer will be the same, no matter what page.

In my header I have a login form. So there will be a login form across the whole site. Now since it appears on every page which has diff models, How will or where will i write the script for loging in a user as I don't fancy writing a login script on every model the header is used on...

I hope i was clear. Again I Just started using CI and MVC a day ago. It would be nice if you could guide me.

Thanks,
Vidhu
#2

[eluser]CroNiX[/eluser]
You can create a library and autoload it. You can create helpers. You can create a base controller (MY_Controller) and do it there and it will do it for all calls to controllers that extend the base controller.




Theme © iAndrew 2016 - Forum software by © MyBB