I am building a crm system for a client, and I am just doing some basic template management & design.
When including these templates I currently have a function that fopens the file (with read header) then fread's the contents, and replaces what it needs to replace, then outputs that to the requester.
Now this is fine, however some elements inside those pages require other template files to be included for example the search box appears everywhere so I use a template for it. Now my script currently seperately fopens the file every time that search box needs to be shown.
Is that an OK way of doing it, or am I just wasting I/O's and, should I just use a database and put all the much repeated sections in there?
Or should I, in fact use a file containing certain functions that would just display the output from a variable inside that very file?
Cheers for your responces.