[pLog-general] why split html files into pieces?

Oscar Renalias oscar at qdevel.com
Sat Nov 13 16:53:00 GMT 2004


well you certainly can use exactly one file without including any 
other .template resources into it if you want. The fact that the default 
package chose to do so doesn't mean that template authors cannot do it.

The idea is that when you have 6 .template files which all use the same header, 
footer, stylesheet, etc, you have two choices: copy the *same* html markup in 
all 6 files or on the other hand, separate those common parts (header and 
footer are the most common ones) and use smarty's {include...} for 
automatically loading them every time the whole template is rendered.

If we were talkinga about OOP, we would say "code reusability"... You don't 
copy+paste the same class if you need it more than once in different places, 
right? Well, this is the same idea :)

Oscar

Mensaje citado por su baochen <subaochen at 126.com>:

> hi,
> 
> I noticed that all template files are splitted into
> pieces:header.template,footer.template and etc,it seems that ths is
> indeed a common way to construct html pages in other php project.
> 
> 
> But how do you benifit from this kind of organization? How about just
> use the native template in dreamweaver or other html editors, such as
> bluefish? I think the native template is easier to maintain that the
> splitted files.
> 
> Any idea?
> 
> -- 
> su baochen <subaochen at 126.com>
> 
> 
> _______________________________________________
> pLog-general mailing list
> pLog-general at devel.plogworld.org
> http://devel.plogworld.org/mailman/listinfo/plog-general
> 







More information about the pLog-general mailing list