RE: [PHP] Architecture Question
| From: | Dan | Date: | Sat, 05 Aug 2000 23:02:52 +0000 |
| Subject: | RE: [PHP] Architecture Question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-10279@lists.php.net to get a copy of this message | ||
I prefer to have each file do an include because the web reporting software
will be able to track files by name. Some reporting packages allow you to
map arguments to files, but this approach works generically with all
packages.
start of fileone.phtml:
<?
include( "header.ph" ); // handles all common page setup, prepares content
area
// drop content below
?>
<b> this is some content </b>
<?
include( "footer.ph" );
?>
end of fileone.phtml
> 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
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>