Jump to content

Site Organization


genericnumber1

Recommended Posts

A website where individual pages are classes implementing a controller interface. index.php creates the instance of the page controller class depending upon a get variable and calls a common method defined by the controller interface.

vs

Doing the pages the classic way with the logic embedded on them individually.

Any opinions? I can never decide between these, the first has some advantages over the second but can be pretty overkill at times, am I thinking too Java?
Link to comment
https://forums.phpfreaks.com/topic/35149-site-organization/
Share on other sites

I generally use the second form, and have header.php, footer.php and maybe other "output includes" if the project requires them.

There's no [i]real[/i] problem with first form, though as you say it can be a little overkill sometimes.  Unless you're using a database to store the content (and hence bordering on the CMS/blog scale of things), you'll probably have separate files anyway for each page so there's no [i]real[/i] advantage to my mind.

In practice, I've done a number of sites where I use [url=http://www.pivotlog.net]Pivot[/url] as either a blog or news engine (i.e. the second form) and embed that on one page of a more traditional site (i.e. the first form).  So as in most things, combining the two is often a good approach. ;)
Link to comment
https://forums.phpfreaks.com/topic/35149-site-organization/#findComment-167057
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.