Page 1 of 1

Webpage full made of only includes

Posted: Fri Apr 11, 2008 5:56 am
by davidtube
Just wondering if people ever make pages like this ?

Code: Select all

<html>
<?php
include header.php;
include top.php;
include middle.php;
include bottom.php;
?>
</html>

Re: Webpage full made of only includes

Posted: Fri Apr 11, 2008 8:46 am
by aceconcepts
I don't think it would offer much flexibility for future development.

Is this how you're planning to structure your site?

Re: Webpage full made of only includes

Posted: Fri Apr 11, 2008 8:50 am
by Chris Corbyn
I think what you're referring to is a "composite view". That's a very common way of piecing together the components on the page. If you've got complicated logic (i.e. business logic) inside any of those includes then there are better ways of structuring things :)

Re: Webpage full made of only includes

Posted: Fri Apr 11, 2008 10:20 am
by davidtube
Well it's a simplified version of what I was thinking of. More likely It'll be more like this:

Code: Select all

<html>
<?php
include header.php;
include top.php;?>
This is page 4. It's the best page!
<?php include bottom.php;
?>
</html>

Re: Webpage full made of only includes

Posted: Fri Apr 11, 2008 10:41 am
by aceconcepts
Yeh, that seems more flexible to me :D