Page 1 of 1

Date Field as Title Field

PostPosted: Thu Mar 12, 2009 2:11 pm
by andperry
Hi Steve,

First of all, please excuse me for asking lots of questions at the moment. I suppose that I am still getting to grips with Xataface having been using it for less than a month. Could I take this opportunity however to say that so far I am highly impressed with it all. Anyway now to my latest problem.

I've got a table in which the primary key is a date field and I want to use it as the title field. The simple approach of putting title=1 in fields.ini works fine. To get a more complex title, I've tried putting something like this in the delegate class for the table:-

function getTitle(&$record)
{
return 'Week commencing '.$record->val('date');
}

The word 'Array' is displayed instead of the actual date. Presumably I'm doing something wrong.

Thanks,

Andrew.

PostPosted: Fri Mar 13, 2009 7:51 am
by shannah
Dates are stored as an arrays. If you want to display it as a string use the strval() method instead of the val() method.

-Steve