[Phpwm] Site Structure

Joe Beard joe.beard at gmail.com
Fri Dec 9 20:01:10 GMT 2005


 My current site has just one skin.php file which contains header,
footer and body functions, which I can then supply content to, or
alter to become page specific, so a general file takes on the form:

include("/functions/skin.php");
page_header();
page_body_title("This is a Page");
page_body_content("Some content here");
page_footer();

but this means I can then call the functions for different purposes,
for example 90% of my site doesn't use frames, but I have a cgiirc
forum, so that page has frames that contain the page_header() function
with arguments to return just the side bar for example.

maybe complicated to setup, but makes adding new pages really easy.

Joe

On 12/9/05, Tom Jemmett <tom.jemmett at gmail.com> wrote:
> On 09/12/05, David Goodwin <david at codepoets.co.uk> wrote:
> >
> > > Another way of doing this would be a switch statement:
> > >
> > > switch ($_GET['page']) {
> > >   case "pictures":
> > >     include ("pictures.php");
> > >     break;
> > >   case "news":
> > >     include ("news.php");
> > >     break;
> > >   default:
> > >     include ("welcome.php");
> > > }
> > >
> > > I think this looks better and is easier to understand when you look
> > > back at your code.
> >
> > Interestingly (?) I did actually write something like that to start
> > with, and then thought it would involve less repetition using an array.
>
> An Array uses less repetition, but as I said, I think it is easier to
> understand because it is less cryptic than loops and if statements.
> Plus you could have the news page named as something other than
> news.php (I think some one pointed this out?)
>
> _______________________________________________
> Phpwm mailing list
> Phpwm at mailman.lug.org.uk
> http://mailman.lug.org.uk/mailman/listinfo/phpwm
>



More information about the Phpwm mailing list