$contentRenderer
$contentRenderer : \Dewdrop\Fields\Helper\CsvCell\Content
The helper used to render content.
The CsvCell helper actually composes 2 simpler helpers that are useful when customizing the rendering of a CSV export:
CsvCell.Content: This helper will allow you to customize the content of your CSV export's data rows.
Customizing the rendering of your cell's content in a view script:
$renderer = $this->csvCellRenderer(); $renderer->getContentRenderer()->assign( 'my_table_name:my_field', function ($helper, array $rowData, $rowIndex, $columnIndex) { return $helper->getEscaper()->escapeHtml($rowData['my_field']); } );
Customizing the rendering of a header in your model (typically in the init() method of a \Dewdrop\Db\Table sub-class):
$this->customizeField( 'my_field', function ($field) { $field->assignHelperCallback( 'CsvCell:Header', function ($helper, $field) { return 'Return a custom string rather than using the field label'; } ); } );
$contentRenderer : \Dewdrop\Fields\Helper\CsvCell\Content
The helper used to render content.
$headerRenderer : \Dewdrop\Fields\Helper\CsvCell\Header
The helper used to render header.
getContentRenderer() : \Dewdrop\Fields\Helper\CsvCell\Content
Get the content renderer so you can assign custom callbacks or render your CSV.
getHeaderRenderer() : \Dewdrop\Fields\Helper\CsvCell\Header
Get the header renderer so you can assign custom callbacks or render your table headers.