Welcome Guest, Not a member yet? Register   Sign In
Header loading twice
#1

[eluser]MrBaseball34[/eluser]
I'm trying to load a view inside my header and the header is getting loaded again in
the view I'm trying to load.

Any ideas?
#2

[eluser]Michael Wales[/eluser]
Please paste your code.
#3

[eluser]MrBaseball34[/eluser]
It's way too long.

I am loading the header in the index and in the header, I'm trying to load two other views
and the header is being sent again when the first view is being loaded in the header.
#4

[eluser]Michael Wales[/eluser]
This is how it should look.

Controller:
Code:
function index() {
  $this->load->view('header');
}

View - Header:
Code:
<html>
  <head>
    <title>Wizard</title>
  </head>
  <body>
    <? $this->load->view('content'); ?>
    <? $this->load->view('sidebar'); ?>
  </body>
</html>

Is yours similar in nature?

BTW: I think the logic is kind of backwards in this example - you should really load a unique template for the method, which would then load the header, footer, sidebars, whatever else. I can foresee a lot of issues using the header as the entry point to the template.




Theme © iAndrew 2016 - Forum software by © MyBB