RE: [Phplib-users] dumping vars in a block
Brought to you by:
nhruby,
richardarcher
|
From: Daniel B. <bo...@io...> - 2001-08-14 00:14:53
|
sorry, may bad
forgot to say, that I only wanna set address2 if it exists
if ($q->f("address1")) {
$tpl->set_var("address2",$q->f("address1")."<br>";
} eles {
$tpl->set_var("address1","");
}
if ($q->f("address2")) {
$tpl->set_var("address2",$q->f("address2")."<br>";
} eles {
$tpl->set_var("address2","");
}
if ($q->f("address2")) {
$tpl->set_var("city",$q->f("city")."<br>";
} eles {
$tpl->set_var("city","");
}
then in the html I have=20
{address1}{address2}{city}{state}{zip}
so I don't get a blank line if address2 does not exist.
-----Original Message-----
From: Richard Archer [mailto:rh...@ju...]
Sent: Monday, August 13, 2001 5:08 PM
To: php...@li...
Subject: Re: [Phplib-users] dumping vars in a block
At 4:41 PM -0700 13/8/01, Daniel Bondurant wrote:
>I am using the template class.
>I have a repeating block in a while loop with about 25 vars in it.
>...
>not every record is going to have address2
>how do I clear out all the vars in this block before setting them all
>for the current record and parsing again.
Won't the line:
$tpl->set_var("address2",$q->f("address2");
clear the var if there's no value?
...Richard.
_______________________________________________
Phplib-users mailing list
Php...@li...
http://lists.sourceforge.net/lists/listinfo/phplib-users
|