mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2024-12-29 01:26:11 +01:00
cda38af84b
The delete action is triggered using a form with a submit button, causing a POST request to be sent instead of a GET request. This is because GET requests should not modify (or delete) data, but only read it and be idempotent. Also, the request then is guaranteed to not get cached. From a usability perspective, a button instead of a link also is semantically more correct: A link is expected to bring you to some place, whereas a button is expected to trigger some action. Closes #871
53 lines
1.5 KiB
PHP
53 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use TTN\Tea\Controller\FrontEndEditorController;
|
|
use TTN\Tea\Controller\TeaController;
|
|
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
|
|
|
|
defined('TYPO3') or die('Access denied.');
|
|
|
|
// This makes the plugin available for front-end rendering.
|
|
ExtensionUtility::configurePlugin(
|
|
// extension name, matching the PHP namespaces (but without the vendor)
|
|
'Tea',
|
|
// arbitrary, but unique plugin name (not visible in the BE)
|
|
'TeaIndex',
|
|
// all actions
|
|
[
|
|
TeaController::class => 'index',
|
|
],
|
|
// non-cacheable actions
|
|
[
|
|
TeaController::class => '',
|
|
]
|
|
);
|
|
ExtensionUtility::configurePlugin(
|
|
'Tea',
|
|
'TeaShow',
|
|
[
|
|
TeaController::class => 'show',
|
|
],
|
|
[
|
|
TeaController::class => '',
|
|
]
|
|
);
|
|
|
|
// This makes the plugin available for front-end rendering.
|
|
ExtensionUtility::configurePlugin(
|
|
// extension name, matching the PHP namespaces (but without the vendor)
|
|
'Tea',
|
|
// arbitrary, but unique plugin name (not visible in the BE)
|
|
'TeaFrontEndEditor',
|
|
// all actions
|
|
[
|
|
FrontEndEditorController::class => 'index, edit, update, create, new, delete',
|
|
],
|
|
// non-cacheable actions
|
|
[
|
|
// All actions need to be non-cacheable because they either contain dynamic data,
|
|
// or because they are specific to the logged-in FE user (while FE content is cached by FE groups).
|
|
FrontEndEditorController::class => 'index, edit, update, create, new, delete',
|
|
]
|
|
);
|