I’ve seen several scripts during my time as a web programmer (I’m still new though) which had PHP included in an uncommon way.
The PHP was not added the usual way like <div><?php echo $foo; ?></div>, but this way: <div>{FOO}</div> or this <div>{$foo}</div>.
I am wondering how I could achieve such a thing? I really want to learn this thing.
Can someone direct me to the correct sources to learn this?
Thanks.
It has to be a template engine? You inject values to it from a PHP script. Smarty is a basic example.
For example, from your PHP page, you write :
And, your template page would look like
with .tpl extenstion.
When the program is run, the template variable {foo} will be replaced by its assigned value “Bar Baz”