Re: My template idea...

From: Date: Tue, 15 Feb 2000 20:49:49 +0000
Subject: Re: My template idea...
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.template 
Request: Send a blank email to php-template+get-45@lists.php.net to get a copy of this message
On Tue, 15 Feb 2000, Dan Libby wrote: > The PHP code would, eg: > > globals.php > ----------- > $global_attrs["page_bgcolor"] = "white"; > $global_attrs["page_width"] = "600"; > > randomfile.php > --------------- > <?php include "globals.php"; ?> > > #load template > $tmpl = tmpl_define("randomfile.tmpl"); > > #assign global vars > tmpl_assign($tmpl, $global_attrs); # assigns set of key/val pairs in one call. > > #print template > echo tmpl_getbuf($tmpl); > > randomfile.tmpl > ---------------- > <body bgcolor="{{page_bgcolor}}"> > <table width="{{page_width}}"><tr><td>random > stuff</td></tr></table> > </body> > > ...and of course the same variables could be used in other PHP code that doesn't use > templates simply by referencing $global_attrs. Right, that's what I was trying to figure out - who should be responsible for loading config files like that - developer or designer. Does designer lose anything if the developer does it? -Andrei Complexity in the mind is not caused by learning; learning is caused by complexity in the mind. -- Steven Pinker

« previous php.template (#45) next »