Re: Wrap content with a layout file

From: Date: Mon, 23 Sep 2002 08:06:08 +0000
Subject: Re: Wrap content with a layout file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-117247@lists.php.net to get a copy of this message
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 (patrick@webation.com) 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 > >

« previous php.general (#117247) next »