DataGrid_Column
| From: | Chris Boget | Date: | Sat, 30 Sep 2006 00:47:06 +0000 |
| Subject: | DataGrid_Column | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-25303@lists.php.net to get a copy of this message | ||
I'm trying to get the value of one of the columns in my table passed to nl2br for display. However, when the column value does get displayed, it shows up as Array. Here is how I'm adding my column to the datagrid:
$datagrid = new Structures_DataGrid( 10 )
$datagrid->bind( $users );
$datagrid->addColumn(new Structures_DataGrid_Column('User', 'uid', 'uid'));
$datagrid->addColumn(new Structures_DataGrid_Column('Comments', 'comments', 'comments', null, null, 'nl2br()'));
echo $datagrid->render( DATAGRID_RENDER_TABLE );
When it gets displayed, it shows the user column fine but the comments column has 'Array'. In Structures_DataGrid_Column, the formatter() method is running the call_user_func() on line 236 but I'm not sure if that's the one it should be using. Am I doing this wrong? Can I not use nl2br()?
thnx,
Chris