Page 1 of 1

Compiling to html for speed - staying in synch

Posted: Fri Jan 15, 2010 2:06 pm
by likewater
I have inherited an well organized site that I'm trying to figure out. The code is well organized and intelligently commented(!)

One of the smart things I see is some of the heavily used stuff like header.php which displays the banner and navigation, exists as both header.php and header.html. So here's the question. Generally, header.html is include_once all over the place.

I want to make changes to the navigation, say add a new tab. I am thinking that there is an automated way to generate header.html from header.php, but I'm not sure how that is typically done. I'm hoping there is a handy tool, or do I have to load the page, view source, then manaually cut/paste?

Thanks,

Eric

Re: Compiling to html for speed - staying in synch

Posted: Fri Jan 15, 2010 2:33 pm
by pickle
That kind of depends on how the system is set up. Looking through the code in header.php, can you see if it generates source which it then stores in header.html? If not, you could probably write a wrapper yourself using ob_start() and ob_get_clean() and writing to the file.

Re: Compiling to html for speed - staying in synch

Posted: Fri Jan 15, 2010 3:36 pm
by likewater
Don't see any output buffer capture.

I was thinking there might be an external tool to use.