I have created my own TYPO3 Extension. This extension will show a list of files. In the backend i can create new categories. In these categories I can add new files. This works. But when I will link the download button to new controller action, it appears always an error.
I created a new Controller (Classes -> Controller -> DownloadController.php). The file contains the following:
namespace Mbdownloads\MbDownloads\Controller;
class DownloadController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
/**
* action list
*
* @return void
*/
public function downloadAction() {
//$files = $this->fileRepository->findAll();
$this->view->assign("sample_var", "sample value");
//$this->view->assign('files', $files);
}
In the ext_localconf.php
I added the following lines:
'Mbfilelist',
array(
'Category' => 'list,show,test',
'File' => 'show',
'Download' => 'download',
Then I added the following file: Resources/Private/Templates/Download/Download.html
Finally in the show action template I add the fluid downloadlink to the controller:
<f:link.action action="download" controller="Download"><i class="fa fa-download"></i> File Download</f:link.action>
Url:
index.php?id=217&tx_mbdownloads_mbfilelist%5Baction%5D=download&tx_mbdownloads_mbfilelist%5Bcontroller%5D=Download&cHash=c1ee54cc5ccaedbeeeeef098a2029e5c
But now i get only: Oops, an error occurred! :(
The only action which works is the show action?! Classes/Controller/CategoryController/showAction
If I add an action in this controller, exampleAction and I will call those action, the same error: Oops, an error occurred!
Thanks for help! I use TYPO3 6.2.16 ...