Categories > TinyButStrong general >

problem with array

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Tom Watson
Date: 2004-08-30
Time: 22:07

problem with array

Hello,

I'm do not understand why I'm am getting the following error:
TinyButStrong Error (Array value): Can't merge [tbs.file_number] because there is no key named 'file_number'.

Here's a dump of the array:
Array ( [entry_date] => 2004-08-01 [file_number] => ATRISK-1038 )

Here a snippet of the offend html :
    <td colspan="5"><font color="#FFFFFF" align="center" class="title-page">CLIENT INFORMATION - [tbs.file_number]</font></td>

The php:
$TBS = new clsTinyButStrong ;
$TBS->LoadTemplate('update_client.html') ;
$TBS->MergeBlock('tbs',$clientrec) ;
$TBS->Show() ;

I can't see the difference between the array example and my code. Your help will be appreciated.

By: Skrol29
Date: 2004-08-30
Time: 23:32

Re: problem with array

Hi Tom,

That because your array should be an embeded array.
$clientrec = array(array( 'entry_date' => '2004-08-01', 'file_number' => 'ATRISK-1038' ) ) ;

If its not an embeded array, available field names are only only 'key' and 'val'.
By: Tom Watson
Date: 2004-08-31
Time: 03:53

Re: problem with array

Thank you Skrol29. I will try an embedded array and see how it goes.

Tom