Add PHP template support

This PR ends the work started by @Venzon in #68