Bug in CI2 view logic, or my logic? |
[eluser]dallen33[/eluser]
I'm using the latest CodeIgniter 2 and I'm loading some views in a relatively simple manner: Code: function index() And here's my HTML view: Code: <?php echo $header; ?> Problem is, my $footer is actually appearing after $toolbar. So my generated HTML looks like this: Code: <div id="toolbar"> Any idea why this is happening?
[eluser]dallen33[/eluser]
Not sure why this works (anyone care to explain?), but I altered the code: Code: $data['footer'] = $this->load->view('footer', '', TRUE); Now it works as it should (displaying on the bottom of the page). So what was the issue?
[eluser]bl00dshooter[/eluser]
bugs go here: http://ellislab.com/forums/viewforum/51/
[eluser]Bart Mebane[/eluser]
@dallen33: Without the third parameter, load->view echoes the html immediately instead of returning it. If you set the third parameter to TRUE, it returns the html as a string without echoing it.
[eluser]danmontgomery[/eluser]
http://ellislab.com/codeigniter/user-gui...views.html Quote:Returning views as data |
Welcome Guest, Not a member yet? Register Sign In |