First you have some globally accessible array of key->value pairs which contain the data to be entered into templates Then you have some template files tem_set($key, $value) tem_get($key) tem_run($file/template) tem_echo($file/template) { echo tem_run($file); } This should work for simple templates such as: foo: '~foo~' It gets trickier when you have bits in your template that need to be repeated (with different tags each time) and others perhaps not displayed at all. foobar.html:
foo | bar |
---|---|
~foo~ |
foo | bar |
---|