IT Template issues

From: Date: Mon, 21 Jul 2003 18:03:43 +0000
Subject: IT Template issues
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-6690@lists.php.net to get a copy of this message
I have bee using the HTML/IT.php package quite happily for a while now on PHP 4.2.2. However I have just tried to install some code on another machine using 4.3.0 and have run into problems. I seem to be having problems were I have an empty block that I want to preserve. Now I know I could use the Select.php package to do the following but I have my reasons (although now I come to think of it, I can't remember why): <select class="leftMenu" name="newcompanyid"> <!-- BEGIN companySelect --> <option value="{companySelectId}" <!-- BEGIN companySelected -->selected <!-- END companySelected -->>{companySelectName}</option> <!-- END companySelect --> </select> Excuse the word wrap. And the following code: /* Fetch the results */ while ($row = $result->fetchRow (DB_FETCHMODE_ASSOC)) { if ($row['id'] == $this->defaults['companyid']) { $template->setCurrentBlock ("companySelected"); $template->parseCurrentBlock ("companySelected"); $template->touchBlock ("companySelected"); } $template->setCurrentBlock ("companySelect"); $template->setVariable ("companySelectId", $row['id']); $template->setVariable ("companySelectName", $row['name']); $template->parseCurrentBlock ("companySelect"); } Now in PHP 4.2.2 all works fine and I get the following: <select class="leftMenu" name="newcompanyid"> <option value="70" >Company 70</option> <option value="1" selected >Company 1</option> </select> Hoever in PHP 4.3.0 I get this: <select class="leftMenu" name="newcompanyid"> <option value="1" selected >My Company</option> <option value="" selected ></option> </select> is this a bug or am I doing something wrong? Thanks Jake

« previous php.pear.general (#6690) next »