php template enhancement