Date Field as Title Field

A place for users and developers of the Xataface to discuss and receive support.

Date Field as Title Field

Postby andperry » Thu Mar 12, 2009 2:11 pm

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.
andperry
 
Posts: 57
Joined: Wed Feb 18, 2009 9:20 am
Location: Wirral, UK

Postby shannah » Fri Mar 13, 2009 7:51 am

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
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 14 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved