Page 1 of 1

Delegate class trouble

PostPosted: Thu Jun 04, 2009 9:12 am
by mikep
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

PostPosted: Thu Jun 04, 2009 7:00 pm
by shannah
Looks like your PHP has short tags turned off. Try changing your opening php tag to <?php instead of just <?

PostPosted: Fri Jun 05, 2009 6:18 am
by mikep
Ok. Adding <?php did the trick. I enabled short open tags in my php.ini file but that didn't seem to work.

Thanks

PostPosted: Fri Jun 05, 2009 10:34 am
by shannah
Did you restart your webserver after making the changes to your php.ini file?

PostPosted: Fri Jun 05, 2009 11:40 am
by mikep
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