load problem? |
[eluser]Avril[/eluser]
Hello, I'm having a problem with some variables that I want to print out on a header page. Let's say that I have a header.php and a index.php in my views folder. The header.php is included in the index.php, I've done this to re-use the same header file for other pages. The data that will be printed out in the header.php comes from the nav.php in the controller folder. Here's the code in the nav.php file: Code: <?php And here's the code in the header.php file: Code: <?php echo doctype('html4-strict') ?> When I load the page I get this error: Quote:A PHP Error was encountered Not sure what I'm doing wrong here?
[eluser]Ephyzy[/eluser]
Hey Im a n00b myself but I think I see the problem. You are not meant to "include" the header.php in index.php !!! The Nav controller sends your nav link data "$link" to a VIEW called header, which of course does not exist, or is in the wrong location. Move the header.php into ur view folder and remove the include from index.php As for how to use the header.php in multiple views, read this CI forum thread: http://ellislab.com/forums/viewthread/169208/ Hint: You almost NEVER need to edit the index.php file in CI. Cheers... |
Welcome Guest, Not a member yet? Register Sign In |