Welcome Guest, Not a member yet? Register   Sign In
Header code on every controller
#1

[eluser]Emanuel01[/eluser]
Hello
I want to make a structure on my site : header - content - footer . On header i have user auth, clock .. ( php code .. )
My question is : how i put the header on every controller ? ( my header is a controller too.. )
I`ve search on the forum and i`ve find some solutions with wick but i`m not sure if this is right for me .

Thx.
#2

[eluser]Colin Williams[/eluser]
Ah! It's our daily question. Best, most long-term solution would be creating a parent controller or controllers. Search MY_Controller and see the User Guide page on Extending Core Libraries for more information.
#3

[eluser]Emanuel01[/eluser]
Thx for the fast reply, i`ve find some info about MY_Controller and i think that i`ve understand. ( extend a controller class right ? )
#4

[eluser]Emanuel01[/eluser]
OK here is my solution at this problem ( without wick or other library like this .. ) is like Collin says but with more detalis
You extend your controller : MY_Controller where you put 2 functions: header and footer then you call this function on your class. You can use templates too ( i use smarty and i include on every page the header and footer template )
#5

[eluser]garrettheel[/eluser]
You could use a simple library to load a header and footer around your content. I put one in the Ignited Code section, take a look




Theme © iAndrew 2016 - Forum software by © MyBB