howto include a controller from a forum template? |
[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
[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.
[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. |
Welcome Guest, Not a member yet? Register Sign In |