CodeIgniter Forums
Modular Page - 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: Modular Page (/showthread.php?tid=3309)



Modular Page - El Forum - 09-23-2007

[eluser]Kemik[/eluser]
Hello all,

Firstly, I want to say that by modular in this case I don't mean the file structure, I mean the page structure.

I'm building a iGoogle (Google Homepage) style interface for my friend's business. It will have 3 or 4 sections.

1. Calendar with icons for different tasks.
2. Today's tasks with icons for mark done, edit and delete.
3. Shoutbox style system with the top half of the section the messages, the bottom half the input box.

The page is split in to 1/4's. One for each section.

How would be best to code this? Especially the view file. Keeping it separate from each other (file system) would be most wanted as it makes maintaining easier.


Modular Page - El Forum - 09-24-2007

[eluser]Phil Sturgeon[/eluser]
You could perhaps split it into 1 view segment for each of the different sections, then have a master view that would load each section in? The master view would look like:

Code:
<div id="calender">
&lt;?=$this->load->view('calender', array(), TRUE);?&gt;
</div>
<div id="tasks">
&lt;?=$this->load->view('tasks', array(), TRUE);?&gt;
</div>

Would involve you passing the information in a clever way, perhaps have a multi-dimentional array like:

Code:
$data['calender'] = $stuffs;

Then you can insert the $calender variable in the view load.


Modular Page - El Forum - 09-24-2007

[eluser]Code Arachn!d[/eluser]
You could also look at CoolFactor's view library. It expands on some of the heavy lifting that the current CI views are limited in my opinion.


Modular Page - El Forum - 09-24-2007

[eluser]Phil Sturgeon[/eluser]
Its not CI's View system thats weak, it does exactly what it says on the tin. Using views as a templating system is indeed weak, but thats a very different matter. CoolFactor does a good job of merging the difference between the two.


Modular Page - El Forum - 09-24-2007

[eluser]Code Arachn!d[/eluser]
[quote author="thepyromaniac" date="1190667731"]Its not CI's View system thats weak, it does exactly what it says on the tin. Using views as a templating system is indeed weak, but thats a very different matter. CoolFactor does a good job of merging the difference between the two.[/quote]

Hmm yes that's a good point - because CoolFactor's library just uses the existing tools - just rearranges them a little bit...


Modular Page - El Forum - 09-24-2007

[eluser]Phil Sturgeon[/eluser]
Yea the re-arrangements and modifications are what make it into more of a templating system. The user manaul says that the view library is not intended as a tempating system (like Smarty for example), its just a layer of seperation.