Welcome Guest, Not a member yet? Register   Sign In
View loading problem
#1

[eluser]CoolGoose[/eluser]
I was trying to load a view from another view and for some reason it breaks the application.
The controller is:
Code:
class Frontpage extends Controller
{
    function __construct()
    {
        parent::Controller();
    }



    function index()
    {
        $this->load->view('partials/header');
        $this->load->view('frontpage', $data);
        $this->load->view('partials/footer');
    }  

}
And in the partials/footer file I've tried to load another view
Code:
$this->load->view('partials/login');

Any ideas ?
#2

[eluser]Randy Casburn[/eluser]
What scope is $this in your 'partials/footer' view file?

Randy
#3

[eluser]CoolGoose[/eluser]
Well they should be on the same scope. To be more exact. When i try to load another view (the login one) from a view (the footer) it only shows the login one without the header/frontpage/footer ones.

/le
I tried

Code:
<?php
$this->ci =& get_instance();
$this->ci->load->view('partials/footer');
?>

in the footer. It's the same.
#4

[eluser]Randy Casburn[/eluser]
Should work fine...but you've not given us a lot to go on.

Quote:for some reason it breaks the application

Based on what you've provided I can't help. More information on the exact error etc. would be more helpful.

Randy
#5

[eluser]CoolGoose[/eluser]
Well the thing is that it'd doesn't show an actual php error. It only displays the newly loaded view and not the others. So only $this->load->view('partials/login'); gets displayed.
#6

[eluser]Randy Casburn[/eluser]
turn on error reporting in CI...let's see what CI reports then.




Theme © iAndrew 2016 - Forum software by © MyBB