getTitle on an array

Archived from the Xataface Users forum.

wisni1rr — Fri Feb 24, 2012 9:51 am

I have a field that is a multi-checkbox from a valuelists. This field also serves as the title field for this record. However, my function simply returns the word ‘array’.

Code: Select all
function getTitle(&$record){       return $record->val('Exterior');    }

Any ideas?


shannah — Fri Feb 24, 2012 11:04 am

Multi-checkbox fields are stored as an array. The val() method returns the contents of a field as they are stored (dates will also return arrays). If you want to ensure that you are getting the string version you should use either strval() or display()


wisni1rr — Fri Feb 24, 2012 1:05 pm

Thank you so much.