implement php template scripting