Hi,
I am trying to use Pear::Structures_Datagrid and one of its functions
makes use of a callback function:
class blah extends AppController
{
.
.
.
function doBlah()
{
$datagrid->addColumn(new Structures_DataGrid_Column('Job Type', null,
null, array('width' => '20%'), null, 'getJobType'));
}
.
.
.
//-----------CALLBACK function-------------------
function getJobType($params)
{
extract($params);
$strType = $record['type'];
$strNumericTypeToString = 0;
switch($strType)
{
case 0://regular job
{
$strNumericTypeToString = 'full-time';
}
break;
case 1://internship
{
$strNumericTypeToString = 'internship';
}
break;
case 2://regular job
{
$strNumericTypeToString = 'co-op';
}
break;
}//end switch($strType)
//return $strNumericTypeToString;
return 'two';
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---