View Single Post
Old 04-11-2009, 03:04 PM   #46 (permalink)
ETbyrne
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Default

Quote:
I still don't understand what's so great about them.
It's a "group" of templates you say, but you can group views aswell?

Like having all views for the docs for example, in a docs subfolder in views folder. Then just $this->load->view('docs/viewfile');

I'm still wondering what the purpose of templates is, seeing as views in fact are templates aswell.
Yes, you can group views, but let's say you have a CMS that lets the admin change the site 'template'. In order to change the 'template' you are using then you would have to go through all the source code and change $this->load->view('group1/viewfile'); to $this->load->view('group2/viewfile');

But with templates doing that across the entire site would be as easy as this in an auto-loaded helper:

PHP Code:
$this->dingo->set_template('group2'); 
Plus templates have the advantage of that if you are looking for a template in a group (set) other than the default one and it isn't found, it will then try to load that template from the default set. Something that is regularly done by content management systems.

Quote:
Ideal for use in CMS? What about all of the other uses of such a framework; why just CMS? Also, as I said I've not looked at the code but why use templates, or templates and views, or just views?
They can be used instead of views for any website if you want, it's the fact that you can switch between multiple template sets that make templates ideal for content management systems where the administrator usually isn't going to edit the source code.

Perhaps I should just get rid of views entirely... Thanks for the feedback everyone!
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote