[Phpwm] Site Structure

Simon Ferré simon.ferre at glowinternet.net
Fri Dec 9 20:26:08 GMT 2005


Hi

That's the kind of page management I am looking to implement at some point.

I will also need some admin areas etc, so will need to also add that
functionality too.

That's given me some inspiration.

Simon

-----Original Message-----
From: phpwm-bounces at mailman.lug.org.uk
[mailto:phpwm-bounces at mailman.lug.org.uk]On Behalf Of Joe Beard
Sent: 09 December 2005 19:59
To: phpwm at mailman.lug.org.uk
Subject: Re: [Phpwm] Site Structure


 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
>

_______________________________________________
Phpwm mailing list
Phpwm at mailman.lug.org.uk
http://mailman.lug.org.uk/mailman/listinfo/phpwm




More information about the Phpwm mailing list