Hi, Steve.
So, if I'm understanding aright, if I've a table Schools in my db application and in that table a field 'Zip,' for which I want the NULL to display in my lists, edits, finds, and views as "NULL," then in db/tables/Schools I would put a file called Schools.php in which I would put the following delegate class code, adapting from your note:
- Code: Select all
<?
<class tables_Schools {
function Zip_display($record) {
$val = $record->val('Zip');
if ( !isset($val) ) return 'NULL';
else return $val;
}
}
?>
Alas, this seems to have no effect on the display, so I must be amiss?
I did check the handbook's methods-listing for field__display in the Delegate Class section, and it differs a little from your sample in the initial function label (showing "function %fieldname%__display(&$record)"), but applying those differences also had no effect.
I'm reasonably sure I'm in the right place, since the app breaks w/an error if I have the code significantly wrong--but I'm not sure why the "NULL" isn't appearing.
Thanks...