Displaying Data - HELP

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
jobert
Forum Newbie
Posts: 1
Joined: Tue May 25, 2004 4:37 am

Displaying Data - HELP

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

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