Compiling to html for speed - staying in synch

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
likewater
Forum Newbie
Posts: 2
Joined: Fri Jan 15, 2010 1:53 pm

Compiling to html for speed - staying in synch

Post 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
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Compiling to html for speed - staying in synch

Post 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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
likewater
Forum Newbie
Posts: 2
Joined: Fri Jan 15, 2010 1:53 pm

Re: Compiling to html for speed - staying in synch

Post by likewater »

Don't see any output buffer capture.

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