Re: Architecture Question
| From: | David Rose | Date: | Sat, 05 Aug 2000 20:51:35 +0000 |
| Subject: | Re: Architecture Question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-10270@lists.php.net to get a copy of this message | ||
Daniel Higgins wrote:
> I was wondering what was considered the best way to lay out php files. Does the Phpshop
> model, were all pages go to one file, index.php3, which calls all functions and templates, work
> best, or is it better to have several different pages in PHP Normal Form. I'm starting a
> application soon and was trying to figure out which way is best. I look foward to hearing the
> different opinions.
I've done it both ways. Filtering everything through index.php is easy because you can include
your headers and footers from right there, as well as any globals.
example:
<?
include "html_config.inc";
include "database_connect.inc.php";
include "header.inc";
switch ($action)
{
case "search":
include "search.inc";
break;
case "join":
include "join.inc";
break;
default:
include "home.inc";
}
include "footer.inc";
?>
or even:
<?
include "html_config.inc";
include "database_connect.inc.php";
include "header.inc";
include "$action.inc"; #thus if ?action=search, we load search.inc
include "footer.inc";
?>
Just my .02
David Rose
webmaster, SXSW.com