Hi
I'm currently writing an application for a local school which enables them to edit and publish their list of course through a web-based interface. Courses are stored in a database, and I need to generate a "dump" of this data for use in a print version. Since there are several hundred subjects, my idea is to write a sort of "component" which spits out one single subject in a semi-formatted way, but I see two possible ways of doing this.
A function based solution
I write a function which prints out the subject, and calls this function for each subject in the DB.
Using a template
I write a template page which prints out a given subject. I then include this template page for every subject. (Using include_once).
What is the fastest way? I know that functions carry quite an overhead, and so does includes, but will the overhead for the include be minimized since I use include_once to include the template?
This might seem like a silly problem since this dump is going to happen 2-3 times a year, but the problem is more general. I'm thinking of writing my webpages in the same way, that is, including templates rather than using functions to display data. Both have the advantage of separating the raw data and it's presentation, but which is the fastest? Or is the difference minimal?
Thanks
André Næss