The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Frameworks are a set of components built together to help with specific problems. You have several php-frameworks, and many of them incorporate their own template-engine, though the two are two entirely seperate things.

If you want, you can use templateengines without any specific framework, like smarty. Then, after you see the light, you will cast Smarty into the burning flames of Mount Doom and never look back.

Frameworks are a set of components built together to help with specific problems. You have several php-frameworks, and many of them incorporate their own template-engine, though the two are two entirely seperate things.

If you want, you can use templateengines without any specific framework, like smarty. Then, after you see the light, you will cast Smarty into the burning flames of Mount Doom and never look back.

Thank you your answer.
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.

Template Engine is used to separate presentation layout and style from view logic.

Think of it this way, an engine is to a car as a template class/engine is to a framework.

engine:car::template engine:framework

- You can have different types of engines in a car and there are all sorts of cars. Same thing with frameworks and template engines
- As a whole, a car is more useful as a sum of its parts (brakes, steering) just as a framework provides other functionality to make it more useful (database, email, form validation etc.).

Think of it this way, an engine is to a car as a template class/engine is to a framework.

engine:car::template engine:framework

- You can have different types of engines in a car and there are all sorts of cars. Same thing with frameworks and template engines
- As a whole, a car is more useful as a sum of its parts (brakes, steering) just as a framework provides other functionality to make it more useful (database, email, form validation etc.).

Thanks!
But I hope i can handle it exactly, could you guys give me some example concerning the popular framework and template engines.

e.g.

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???

A template engine is usually just a way to display the results generated by your application. For example, if you are writing a php application, you'll usually need to do stuff like iterate through an array and display all the values in a certain way. A template engine will usually let you assign these dynamic variables, and provide a way to display them.

A framework usually provides not only a way to display the information, but a way to code the actual application as well. For example, common features of a framework include processing request date ($_GET and $_POST variables), database access, user permissions, form validation, and most of all the way you actually organize your application. This differs from templates in that templates only provide display logic, whereas frameworks provide a means to do application logic as well.

With a template engine, you can use any sort of code to provide the information the template needs to display the code. With a framework, you have to code your application in a certain way, dictated by the way the framework does things. The upside to using a framework is that if you learn it very well, you will be able to program applications faster because they provide a structured way to approach a project, as well as pre-written common application logic. The downside is that you have to actually learn the framework (some are very poorly documented), and that you may find limits to what you can do within the framework. You also need to learn template engines, but template engines let you decide how you get the information you provide it yourself.