Page 1 of 1

objects tease me

Posted: Tue Jul 22, 2003 3:06 am
by kafka_loved_his_daddy
Good Morning,


tried to call one class and told her to get another one. but it does not handle it as the var it should have become, but prints 2nd class output somewhere else.

code for the class looks like

Code: Select all

class BuildTable {

  function BuildTable($width, $style, $cellpadding, $cellspacing, $class, $id) {
	echo "
	<table width="$width" style="$style" class="$class" id="$id" cellpadding="$cellpadding" cellspacing="$cellspacing">";

#	echo "
#	</table>";
  }

  function BuildRow() {
	echo "
	 <tr>";
	foreach ($build_td as $value_td => $count_td) {
			echo "
		  <td>$value_td</td>";
	}
	echo "
  	 </tr>";
  }
this, i tried to instantienate like

Code: Select all

$inittable = new BuildTable(); 
$inttable->BuildRow($build_td = array (/*n-times:*/  => /*"call to other class2::function"*/);  // also tried to turn around the values
.
what happens seems starnge to me. php prints class2::function (actually it was an Image) somewhere between

Code: Select all

&lt;table&gt;
and

Code: Select all

&lt;tr&gt;
. also tried to to assign

Code: Select all

$build_td
before calling function BuildRow. same outcome.

thanks to the audience, especially for help. ยต