tags:

views:

133

answers:

4

This might be a really dumb question, but is it dumb to load the data that is in between the tags in a file and load it via PHP include()? That way it would allow for easier editing. Thanks.

+8  A: 

No it would not be dumb. The less duplication of code, the better.

Mike B
+4  A: 

The question is : do you plan to use the same <head> block on several pages ?

If yes, then : no, it is not a bad idea to store it in a file, that can be used for several pages.


A second question would be : does this make things easier for you ?

If yes, then : no, it is not a bad idea to make things easier.


And if you are thinking "this will mean loading/including one more file, will this not kill my server ?"

Then, again : no, it will not : no-one will notice that kind of overhead :-)
(And the file, if used often, will most likely be cached in RAM by your OS anyway)

Pascal MARTIN
+1  A: 

No, why should it be dumb? If it adds structure to your website, and allows for clean design, it would be a good idea.

And it applies DRY.

Ikke
A: 

It follows the DRY (Don't Repeat Yourself) methodology. It's a good idea.

smack0007