From: "Joel Konkle-Parker" <[EMAIL PROTECTED]>

> I'm trying to make a PHP-backed website, and I'm trying to decide between
two
> templating schemes:
>
> 1. define 2 php template files: header.php, footer.php. in index.php,
require
> header.php, output content, require footer.php
>
> 2. define a php template file and a local page file. index.php defines
body()
> and crequires template.php. template.php prints the header, calls body()
to
> print the content, and and prints the footer.
>
> I'm currently using the second method, but I've only seen the first used
> elsewhere. Is there a reason that #1 is better than #2 (or is anything
else even
> better than that?)?

With method 2 it seems like your template file would become redundant
because every one of them would have to contain the header and footer code.

I would use 3 template files, header.php, footer.php, and body_index.php

index.php would:

1. PERFORM LOGIC
2. include header
3. include body
4. include footer

Then, all you have to do is make new body_XXX.php files for each page on
your site and the header/footer content is contained in one place.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to