View Modules in MVC - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: View Modules in MVC (/showthread.php?tid=20338) |
View Modules in MVC - El Forum - 07-06-2009 [eluser]Ickes[/eluser] Continuing my Noob education... Example: Have a blog module and a tutorial module. For the sake of argument, I want the modules to appear in 3 ways. 1) A blog page that displays ONLY the blog module. 2) A tutorial page that displays ONLY the tutorial module. 3) An index page that displays the blog module & the tutorial module. I can take care of 1 & 2 really easy. The _view for each looks something like this BUT in SEPARATE views: Code: //BLOG VIEW -> blog_view.php For #3, I can simply copy and paste that in one index_view.php. However, this gets complicated when I add more things such as author, email, date created, comments, etc. It also reuses a ton of code. So how is this normally done? Before MVC, I would simply have a file named blog.php and tutorial.php. To accomplish #3, I would just php include them both. I assume there is an easy way to do so in MVC but I am struggling with the change in thought. Any help is appreciated. Thanks. View Modules in MVC - El Forum - 07-06-2009 [eluser]Ickes[/eluser] OK, nevermind. Views in Codeigniter Perhaps a little more research would have helped. I understand now that views are exactly what I used to refer to as modules and I also see now how to load multiple views. Duh! |