welcome to ...

pure-PHP templating

Hi. Here is a set of simple php scripts introdusing the idea -

" php - is a great template engine itself "

Better start looking into their source and try to guess what you'll see visiting them in your browser.

home master.php control.php top.php foot.php derived.php block.php helper.php templatelib.php multipass.php
  • master.php - shows default templating features: repeat block, variables, inclusion. Takes business-logic data from control.php
  • control.php - contains data displayed by master.php and derived.php
  • top.php - header included into master.php
  • foot.php - footer included into master.php
  • derived.php - shows template extending feature. It extends master.php by re-defining its region.
  • block.php - example of using text-processing block functions for easy and laconic coding
  • helper.php - another helper-centered implementation of <select> form element. You may also look into block.php and choose the implementation you like for youself.
  • templatelib.php - contains implementation of selectSelector() function used in block.php and functions used in multipass.php
  • multipass.php - sometimes presentation-related data is calculated right in the tempalte. Here is a technickue described which allows to show data, calculated at the bottom of the page at the page top.