I created a button in my TYPO3 backend
<f:link.action class="btn btn-default" action="redirectDownload"
additionalAttributes="{role: 'button'}">
<core:icon identifier="actions-system-extension-download"/>
<f:translate key="redirect_download" />
</f:link.action>
It calls the function in my controller
public function redirectDownloadAction()
{
$this->redirectRepository->getRedirects();
}
and in my repository
public function getRedirects()
{
$connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
$queryBuilder = $connectionPool
->getQueryBuilderForTable('tx_redirects');
$csvData = $queryBuilder
->select("*")
->from('tx_redirects')
->execute()
->fetchAll();
return $csvData;
}
I get the correct data and after executing the info
The technical reason is: No template was found. View could not be resolved for action "redirectDownload" in class "\Controller\RedirectController".
My question is how can I download the SQL-result in a CSV file by clicking the button? and dont get the warning.