RE: [PHP] Wrap content with a layout file

2002-09-23 Thread Michael Egan

I generally do the same - have a header and footer file which create a three column 
table. The content then fits into the central column.

Other ways of doing this might be to use frames (though many disapprove of frames) or 
to use the iframe tag - the latter is something I only recently became aware of but 
can be quite useful and is not as messy as frames.

Michael Egan

-Original Message-
From: Patrick Lebon [mailto:[EMAIL PROTECTED]]
Sent: 23 September 2002 06:47
To: [EMAIL PROTECTED]
Subject: [PHP] Wrap content with a layout file


Is there a way to create a layout file that can wrap around other pages with
data in them. I am currently using two includes (one at the start of the
page and one at the end) but was wondering if there is a better way to do
this.
Thanks



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


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




Re: [PHP] Wrap content with a layout file

2002-09-23 Thread Justin French

Generally I like to have header and footer, but you should look at the
template engines out there (smarty for example) for some inspiration.

This for example, would work fine for a WIDE range of pages:

file.php?include=something:

?
$include = $_GET['include'];
$file = path/to/my/dir/{$include}.html;
if(!file_exists($file)) { $file = path/to/my/dir/error.html; }
?
html
...
? include($file); ?
...
/html


Some prefer one style others prefer another.


Justin


on 23/09/02 3:46 PM, Patrick Lebon ([EMAIL PROTECTED]) wrote:

 Is there a way to create a layout file that can wrap around other pages with
 data in them. I am currently using two includes (one at the start of the
 page and one at the end) but was wondering if there is a better way to do
 this.
 Thanks
 
 


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