Welcome Guest, Not a member yet? Register   Sign In
Best way to avoid duplicating html in views
#3

[eluser]mortifrog[/eluser]
Thanks for your response. OK... using includes was the way I'd always done it before discovering CI. I'm probably wrong but it seems somehow to me, that using includes in the view like this is the not the most CI way of doiing things.

In the tutorial, it talks about loading multple view

e.g:

$this->load->view('header');
$this->load->view('nav');
$this->load->view('content');
$this->load->view('footer');

I'm guessing that the html contained in say the nav view continues the html in the header view - so that if you put those 4 views in one file - they would make a cohesive and valid html page.

Now if I used these same loaders in each control file I want to make - I guess I can pass parameters to the header view appropriate to the controller I'm using.

The content view page could be empty bydefault until I have pieced together the $content parameter to pass to it.

- and I could also load other views into the $content parameter before passing it to the content view as needed.

Am I starting to get it at all? or is it easier just to include other views within views?


Messages In This Thread
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 08:50 AM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 09:31 AM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 10:24 AM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 10:35 AM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 10:46 AM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 01:10 PM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 01:27 PM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 05:44 PM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 06:24 PM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 06:24 PM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 06:54 PM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 08:04 PM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 08:13 PM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 08:18 PM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 08:19 PM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 08:26 PM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 08:27 PM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 08:29 PM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 08:30 PM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 08:32 PM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 08:42 PM
Best way to avoid duplicating html in views - by El Forum - 12-18-2008, 09:04 PM



Theme © iAndrew 2016 - Forum software by © MyBB