Welcome Guest, Not a member yet? Register   Sign In
howto include a controller from a forum template?
#1

[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
#2

[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.
#3

[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.




Theme © iAndrew 2016 - Forum software by © MyBB