Template engines (TEs) can be very useful in web development scenarios where you need to generate and format text automatically according to specific processing rules. Basically, a TE takes a data model, applies a given template, and produces the result document. These engines can also help you build your applications based on the Model-View-Controller (MVC) pattern, making them more robust and maintainable than applications based on spaghetti code. Most programming languages provide built-in or third-party TEs.
Read the full story at Web Developer's Virtual Library: