There are endless possibilities on how you can organise your code and I am unsure how you are doing yours. When I look back at the coding I did when I first started learning php I am somewhat horrified. Even in the beginning I used templates but I used to cram all sorts into it and still ended up duplicating code (and that defeats the point of templates!).
I still only code php for my own interest really but now I have torn to pieces part of a site I was working on a while ago and use that now as a basis for my coding and I also use
smarty which is a template engine that seperates your php and html code.
Nowadays some of my php pages are tiny:
| Text |
1
23
45
67
89
10 | <?php
include_once("include_files.php");
//load templates
$smarty->display(TEMPLATE_SITE_LAYOUT);$smarty->display(TEMPLATE_INDEX);
$smarty->display(TEMPLATE_SITE_FOOTER);
?> |
Each page calls include_files.php which defines where everything is and in turn includes many other files. By the time a page has displayed my script will have easily accessed over 20 php files and 3 template files
If my 'header' files failed then the whole site would fail but I can't think why it would just fail and losing css is generally an irrelevance to whatever else stops working