Page 1 of 1

PHP Framewor and PHP Template Engine

Posted: Fri Nov 26, 2004 8:11 am
by colin_ldp
what's the difference between PHP Framewor and PHP Template Engine?

Are Template engines included as part of a framework???

please help me,

thanks a lot !

Posted: Fri Nov 26, 2004 9:33 am
by patrikG
A template engine usually renders HTML-Templates, e.g. it writes values from a database into a predefined, static layout (the template).

A framework is usually a set of developer tools to facilitate and speed up application production. Whether or not template engines are part of a framework is entirely optional.

Posted: Fri Nov 26, 2004 4:25 pm
by McGruff
As Patrik mentioned, a template engine is solely concerned with presentation. A script defines a bunch of data and passes it to the template engine for display.

A framework is maybe best understood in comparison with a library. A library is a bunch of simple tools which you can use in any way you like. A framework solves some of the design problems of application building and you must fit your application into this structure. Framework components will have been designed to work smoothly together and may or may not work outside the framework environment.

Which parts of your own code are "library" or "framework" is kind of an interesting design issue. As a rule I try to refactor any framework stuff out of classes as much as possible. The fewer assumptions objects make about the environment in which they are called the better.

Posted: Fri Nov 26, 2004 5:35 pm
by colin_ldp
Thank you your answers.
But I also can't understand it exactly,
could you please give me more detail.

A framework is an integrated set of components that collaborate to provide a reusable architecture for a family of related applications. An MVC Framework helps us build applications using the MVC pattern.
for example: PHP.mvc, Mojavi, PRADO ...

Template Engine is used to separate presentation layout and style from view logic.
for example: Smarty or WYSIWYG HTML editors???

Posted: Fri Nov 26, 2004 5:41 pm
by colin_ldp
I hope i can handle it exactly, could you guys give me some examples concerning the very popular framework and template engines.