[Phphtmllib-devel] TRtag::push_reference() bug
Status: Beta
Brought to you by:
hemna
|
From: David M. <da...@re...> - 2002-06-06 14:16:49
|
Hi again,
When using the push_reference() method in TRtag, it sometimes wraps the
inserted thing even when it's actually a TDtag.
Example:
$page = new HTMLPageClass("This page");
$page->push_reference($font);
$font = new
FONTtag(array('size'=>'4','face'=>'arial,helvetica,sans-serif'));
$font->push_reference($table1);
$table1 = new TABLEtag(array('border'=>1));
$table1->push_reference($row[0]);
$table1->push_reference($row[1]);
$row[0] = new TRtag(0);
$row[0]->push_reference($col[0][0]); // forward reference
$row[0]->push_reference($col[0][1]); // ditto
$col[0][0] = new TDtag(0, "Cell A");
$col[0][1] = new TDtag(0, "Cell B");
$row[1] = new TRtag(0);
$col[1][0] = new TDtag(0, "Cell C"); // backward reference
$col[1][1] = new TDtag(0, "Cell D"); // ditto
$row[1]->push_reference($col[1][0]);
$row[1]->push_reference($col[1][1]);
print $page->render();
Produces:
<FONT size="4" face="arial,helvetica,sans-serif">
<TABLE border="1">
<TR>
<TD>
<TD>Cell A</TD>
</TD>
<TD>
<TD>Cell B</TD>
</TD>
</TR>
<TR>
<TD>Cell C</TD>
<TD>Cell D</TD>
</TR>
</TABLE>
</FONT>
Note that the data cells in the first row are being incorrectly wrapped
in an extra 'td' tag. This seems to be happening when I push_reference()
on something I haven't defined yet - TRtag is assuming that it won't be
a column object.
Cheers
David
|