JavaScript + HTML: clientside -> templates
PHP: serverside -> controller :)

Does not depend on the templating language.