-
Notifications
You must be signed in to change notification settings - Fork 63
View
TJ Baker edited this page Nov 20, 2013
·
6 revisions
You can disable the top and side bars.
<?php
$input->set('disable_topbar', true);
<?php
$input->set('disable_sidebar', true);
<?php
$input->set('hidemainmenu', true);
RViewCsv works with RModelList.
You just need to implement getColumns()
to automatically generate a csv file.
This method returns the columns you want to display :
- the array keys match the name of the columns returned by the model list method
getItems()
- the array values correspond to the title you want to display for the corresponding column
<?php
class RedshopbViewDepartments extends RViewCsv
{
/**
* Get the columns for the csv file.
*
* @return array An associative array of column names
* as key and the title as value.
*/
protected function getColumns()
{
return array(
'name' => JText::_('COM_REDSHOPB_NAME'),
'company' => JText::_('COM_REDSHOPB_COMPANY_LABEL'),
'address' => JText::_('COM_REDSHOPB_ADDRESS_LABEL'),
'zip' => JText::_('COM_REDSHOPB_ZIP_LABEL'),
'city' => JText::_('COM_REDSHOPB_CITY_LABEL'),
'country' => JText::_('COM_REDSHOPB_COUNTRY_LABEL'),
);
}
}
The view needs to be saved as view.csv.php
.
You can display a link to the csv view by using the toolbar button.
<?php
// If you are in the normal list view 'view.html.php'
// you don't need to specify the link
$csv = RToolbarBuilder::createCsvButton();
redCORE documentation menu: