本文整理汇总了PHP中CostbenefitprojectionHelper::xls方法的典型用法代码示例。如果您正苦于以下问题:PHP CostbenefitprojectionHelper::xls方法的具体用法?PHP CostbenefitprojectionHelper::xls怎么用?PHP CostbenefitprojectionHelper::xls使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CostbenefitprojectionHelper
的用法示例。
在下文中一共展示了CostbenefitprojectionHelper::xls方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exportData
public function exportData()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// check if export is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('help_document.export', 'com_costbenefitprojection') && $user->authorise('core.export', 'com_costbenefitprojection')) {
// Get the input
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
// Sanitize the input
JArrayHelper::toInteger($pks);
// Get the model
$model = $this->getModel('Help_documents');
// get the data to export
$data = $model->getExportData($pks);
if (CostbenefitprojectionHelper::checkArray($data)) {
// now set the data to the spreadsheet
$date = JFactory::getDate();
CostbenefitprojectionHelper::xls($data, 'Help_documents_' . $date->format('jS_F_Y'), 'Help documents exported (' . $date->format('jS F, Y') . ')', 'help documents');
}
}
// Redirect to the list screen with error.
$message = JText::_('COM_COSTBENEFITPROJECTION_EXPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=help_documents', false), $message, 'error');
return;
}