CodeIgniter Forums
howto include a controller from a forum template? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: howto include a controller from a forum template? (/showthread.php?tid=5016)



howto include a controller from a forum template? - El Forum - 12-31-2007

[eluser]Unknown[/eluser]
I need to include a controller from my forum template (punbb)
The controller does user auth and presents the header for the forum with user information.

How to manage this?

Code:
require('index.php/forum/header');

Doesn't work


howto include a controller from a forum template? - El Forum - 01-03-2008

[eluser]Dready[/eluser]
Hello,

in a good usage of MVC programming you won't include a controller from a template(=view in MVC world), because that's the controller that includes templates.
To solve your problem, a solution will be to create a library that you auto-include and that deal with authentication, and to send your headers from another view of your controller.


howto include a controller from a forum template? - El Forum - 01-05-2008

[eluser]Grahack[/eluser]
require needs a path to a file to work (or a file in the include path). index.php/forum/header is a bit of URL. I coded something for this kind of problems, try a dip into CI.