Page 1 of 1

Displaying Data - HELP

Posted: Tue May 25, 2004 4:37 am
by jobert
Hello all, am new to this forum!

I have an array containing approx 200 strings and want to put them in a template.

Code: Select all

require_once ("customerordersrep.class.php");
	
	$rep = new customerordersrep();
	$custreport = $rep->get();
	
	$t_header = new template("templates");
	$t_lineitem = new template ("templates");
	$t_totalsummary = new template ("templates");
		
	$t_header->load("CustomerReport.htm",true,"HEADER");
	$t_lineitem->load("CustomerReport.htm",true,"LINEITEM");
	
	$customer	= $custreportї"Repository"]ї"ShipToName"];


	$t_lineitem->set("CUSTNAME",$customer);

	$t_totalsummary->load("CustomerReport.htm",true,"TOTALSUMMARY");
	
	$t_header->output();		
	$t_lineitem->output();
	$t_totalsummary->output();
The above is my module that gets the data from the class and displays it into the template. The '$customer' variable is the one i want to be displayed in the '$t_lineitem->set("CUSTNAME",$customer);' but it says an error of array to string coversion.

Anyone have any ideas? Please let me know as soon as possible, cheers.

Joe

Posted: Tue May 25, 2004 10:34 am
by feyd
$t_lineitem->set("CUSTNAME",$customer);

this function is expecting $customer to be a string, format the variable into a string prior to sending it, and all will be good.. I think.