objects tease me

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kafka_loved_his_daddy
Forum Newbie
Posts: 3
Joined: Tue Jul 22, 2003 3:06 am
Location: austria

objects tease me

Post 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. µ
Post Reply