View Single Post
Old 11-16-2004, 09:05 AM   #6 (permalink)
Alcides
Registered User
 
Alcides's Avatar
 
Join Date: Jul 2004
Location: San Francisco
Posts: 2
Alcides is on a distinguished road
Send a message via ICQ to Alcides Send a message via AIM to Alcides Send a message via MSN to Alcides Send a message via Yahoo to Alcides
I think the include() method is also developing with templates, considering that the include('your_header_here') and include('your_footer_here') acts as "common" content.

I agree that it is left to the developer's style of coding. However, I do think falsepride has a good idea here. It does make it a little more pleasing to review if your content is very detail oriented.

You might also consider dividing all the content and using include() instead of of imploding. For instance, seperate the header, content, and footer into seperate files. Instead of layout.html, use layout.php. Include the following in the layout file:

PHP Code:
include('header.php');
include(
'content.php');
include(
'footer.php'); 
Then, you work on the content files individually and save disk space by not having include()'s in every file. It might not be a big deal if your site is small. Yet, if you have a lot of pages, the size can add up.

I believe this is similar to falsepride's method, but instead of implode(), I use include(). I think that both falsepride and my own methods allow for easier management than each "content" file including headers and footers. Although, I think my method uses less disk space than falspride's.

Again, I think it all comes down to a developer's preference.

Alcides
Alcides is offline   Reply With Quote