Re: [phplib] Inserting PHP Files using Templates From: Brian Popp (bpopp <email protected>)
Date: 01/05/01

>>I have been doing this, but it seems to make my site very slow to
>>load. Anyone else tried it? I'm still searching for a way to do it
>>faster, and the method described in Fred Yankowski's tutorial may work
>>better. But can anyone tell me how I could split the code in his article
>>into two functions, one to do the header and one to do the footer?

Yeah, I enjoyed seeing Fred's implementation as well. Thanks for the info,
Fred! A similar alternative to it would be to put the header and footer into
separate files, and then load them separately like so:

$t->set_file ( "main", "index.ihtml" );
$t->set_file ( "headerfile", "header.ihtml" );
$t->set_file ( "footerfile", "footer.ihtml" );

$t->parse ( "HEADER", "headerfile" );
$t->parse ( "FOOTER", "footerfile" );

$t->pparse ( "out", "main" );

Your template would then look like :

{HEADER}
Content goes here..
{FOOTER}

I was initally a little hesitant to add anything to each of my pages to make
them adopt the look and feel of the site, but I'm getting more comfortable
with the idea. I'm also going to give that output buffering a try and see
how that goes. It' can't be any slower than than the http request that I'm
doing now. Thanks to all for the suggestions and please keep em coming!

BPopp - bpopp.net
bpopp at midsouth.rr.com

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>