Re: [phplib] replacement variables From: nathan r. hruby (nhruby <email protected>)
Date: 05/11/01

On Fri, 11 May 2001, Chris Padfield wrote:

> >
> > I plan on having on my site a number of different templates, say 10 main
> > templates with some sub templates.
> >
> > What i am wondering is what people do for consistancy of what i would call
> > replacment variables, such as cellpadding="2" sort of thing. If you change
> > that then it changes the cellpadding across the whole website instead of
> > having to do it for each and every template.
> >
> > I realise you could make a template which was, just, "2" and then do
> > cellpadding="{cellpadding}" but you would end up with hundreds of
> templates.
> >

Can't you parse cellpadding as a varaible in the template? Liek having an
array of display vars that are set from some UI or config file?

<!-- someTpl.tpl -->
<table cellpadding="{CELLPADD}">
  blah blah blah
</table>
<!-- END -->

/* somePage.php */
$t->set_var("CELLPADD", $displayOpts["cellpadding"]);
//Parsing continues...

-n

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
nathan hruby / digital statement
nathan <email protected>
http://www.dstatement.com/

Public GPG key can be found at: http://www.dstatement.com/nathan-gpg-key.txt ED54 9A5E 132D BD01 9103 EEF3 E1B9 4738 EC90 801B -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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