turn everything into php template.