Welcome Guest, Not a member yet? Register   Sign In
header view not loading in correct sequence
#1

[eluser]gscharlemann[/eluser]
using the DX_Auth library, I setup a simple user_profile function. The problem is the header is loading last, despite the call to load it first. I don't get it. Here's the function:

Code:
function user_profile()
    {
        if($this->dx_auth->is_logged_in())
        {
            $this->load->view('header');
            echo "header loaded<br>";
            $this->load->view($this->dx_auth->user_profile_view);
            echo "profile loaded<br>";
            $this->load->view('footer');
            echo "footer loaded<br>";
        }
        else
        {
            $this->login();
        }
    }

When the view is displayed in the browser "header loaded" prints out, but the actual code in the header.php file doesn't show up in the html source file until AFTER the footer.

Any idea what's messed up here? Thanks!
#2

[eluser]pistolPete[/eluser]
Did you try it without the echo statements?
Also have a look at http://codeigniter.com/wiki/Displaying_Multiple_Views/.
#3

[eluser]gscharlemann[/eluser]
I removed the echo statements - no dice.
I'll check out the link about multiple views. thanks for the tip.
#4

[eluser]gscharlemann[/eluser]
the link above appears to be for an older version of CI. I've used this approach (loading the header, content and footer) in many other places and for some reason the above user_profile function is the only location that has a display issue. Does anyone have any idea what might be causing this? It's incredibly frustrating!




Theme © iAndrew 2016 - Forum software by © MyBB