[Phpwm] Site Structure

Iain Wallace iain at strawp.net
Fri Dec 9 11:15:36 GMT 2005


[snip]
>   How do you guys go about setting up your sites in a resourceful way?
>
>   Am I just better off sticking to including a header and a footer on all
> my pages?
>
Yes. On my personal site, and any web applications I write, there are just
two includes: header.php at the top and footer.php at the bottom.

Inside header.php is everything before the actual content text, so it'll
all the page meta data, includes to scripts which declare database
variables, etc and (usually, for me) an include to navigation.php which
builds the site navigation and the various enclosing DIV elements. (Don't
go crazy on nested include()s though, because it's not great for
performance.)

That way, if you have a page that needs to do something before headers are
sent out, like a redirect, you can do it before include(
"includes/header.php" );

The first site I ever wrote I did a similar thing to you: Attempting to
squirt content into a structure - it's much easier to just wrap a
structure round content instead.

Cheers,
Iain



More information about the Phpwm mailing list