Let's make a very simple template engine.
A template engine is used to separate the presentation from the business logic.
A good developer knows this is very important
- not only it allows for delegating responsibilities (the designer works on the presentation layer while the programmer works on the business logic), but it also provides a more easier maintenance.
There are a lot (and I mean A LOT) of template engines for PHP. A very popular example is Smarty.
Most of these template engines have a lot of advanced options and require the user to learn a new syntax for building the template files.
What if you just want some easy to understand and simple to use template engine?
Why not build your own?
In this tutorial we'll do just that - we'll create a very simple template engine in PHP
that anyone can use without having to spend time reading manuals.
A template engine is used to separate the presentation from the business logic.
A good developer knows this is very important
- not only it allows for delegating responsibilities (the designer works on the presentation layer while the programmer works on the business logic), but it also provides a more easier maintenance.
There are a lot (and I mean A LOT) of template engines for PHP. A very popular example is Smarty.
Most of these template engines have a lot of advanced options and require the user to learn a new syntax for building the template files.
What if you just want some easy to understand and simple to use template engine?
Why not build your own?
In this tutorial we'll do just that - we'll create a very simple template engine in PHP
that anyone can use without having to spend time reading manuals.
Comment