Many times, when working with smaller projects, taking the time to separate the presentation from logic is like taking the time to ask guests to leave the dinner table each time a new dish is brought from the kitchen to hide where its coming from. Some programmers have said if lines of code are greater than 1000, go ahead and separate the two. There's no question that projects that are going to involve 100% database stored content can benefit from creating HTML templates and parsing data through them with PHP and the FastTemplate class. Remember that there are many tools for separating presentation and logic and the best one for the job is the one that's desired. Make certain you have the right one before the project gets too deep. Appendix / Notes When installing PHP4 and FastTemplate, it was necessary to edit a line of code in the FastTemplate class in order for it to work properly. Within the parse_template function of the class this line was edited: The curly brackets had not been escaped in the code so the script ignored any variables in the HTML templates.
blog comments powered by Disqus |