Delegate class trouble

Archived from the Xataface Users forum.

mikep — Thu Jun 04, 2009 9:12 am

Ok. So I have a table named Jobs in which the primary key is a column called Job_ID. I want this column to be the title for each record.

I created a delegate class in tables/Jobs named Jobs.php.

the contents of this file are:

<?

class tables_Jobs {

function getTitle(&$record){

return $record->val(‘Job_ID’);

}

}

?>

Its mostly copied right out of the delegate classes tutorial in the documentation.

When I check my Jobs table from my web browser, I get a white screen with the following text in the upper left corner:

val(‘Job_ID’); } } ?>

Any ideas what I’m doing wrong? I am not very familiar with PHP.

Thanks,

Mike


shannah — Thu Jun 04, 2009 7:00 pm

Looks like your PHP has short tags turned off. Try changing your opening php tag to <?php instead of just <?


mikep — Fri Jun 05, 2009 6:18 am

Ok. Adding <?php did the trick. I enabled short open tags in my php.ini file but that didn’t seem to work.

Thanks


shannah — Fri Jun 05, 2009 10:34 am

Did you restart your webserver after making the changes to your php.ini file?


mikep — Fri Jun 05, 2009 11:40 am

I believe so, but its possible that I didn’t. I’ll try again. In any case, its working when i add <?php so thanks a lot.

Mike