最后,我找到了2个解决方案:
打字稿:
plugin.tx_yourext_plugin.features.requireCHashArgumentForActionArguments = 0
和
控制器:(通过方法参数或通过 $ this->request 轻松访问)
public function listAction (int $ argument = 0) {...
或
ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_yourext_plugin[argument]';
和
控制器:
public function listAction() {
$argument = $this->request->getArgument('argument');
流体/HTML:
解决方案 1:
自己的普通 HTML 表单(没有 FLUID / ViewHelper):
<form action = '<f:uri.action action = "cunning" controller = "job"/>' method = "GET">
<select name = "tx_yourext_plugin [argument]">...
解决方案 2:
拥有如下内容的 ViewHelper
- 然后他可以用作原件(他只阻止生产自动生成 __referrer 隐藏字段以及受信任属性的隐藏字段):
class FormViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper {
protected function renderHiddenReferrerFields () {
return ";
}
protected function renderTrustedPropertiesField () {
return ";
}
}
非常感谢https://www.ophidia.net/fluid-fform-referrer-deaktivieren/
对于这两种解决方案:
流体分页:
(注意:从 TYPO3 10 开始,addQueryStringMethod:'POST' 已被贬低)
<f:widget.paginate... configuration = "{... addQueryString: 'true', addQueryStringMethod: 'GET'}">
但是我还有一个问题——我没有得到过滤表单的漂亮网址。
因此,如果我发送表单,则 url 不是很好 - 但如果我在那之后使用分页,那么 url 很好而且干净。
有人出主意吗?
MyPlugin:
type: Extbase
extension: MyExtKeyNameSpace
plugin: PluginName
defaultController: 'Controller::list'
routes:
# - { routePath: '/{page-label}-{page}', _controller: 'Controller::list', _arguments: {'page': '@widget_0/currentPage'} }
# - { routePath: '/{type-label}-{type}', _controller: 'Controller::list', _arguments: {'type': 'pluginTypes'} }
# - { routePath: '/{area-label}-{area}', _controller: 'Controller::list', _arguments: {'area': 'pluginAreas'} }
# - { routePath: '/type-{type}/area-{area}', _controller: 'Controller::list', _arguments: {'type': 'pluginTypes', 'area': 'pluginAreas'} }
- { routePath: '/{page-label}{page}/{type-label}{type}/{area-label}{area}', _controller: 'Controller::list', _arguments: {'page': '@widget_0/currentPage', 'type': 'pluginTypes', 'area': 'pluginAreas'} }
- { routePath: '/{company_slug}/{plugin_slug}', _controller: 'Controller::show', _arguments: {'company_slug': 'company', 'plugin_slug': 'plugin'} }
defaults:
page: ''
type: ''
area: ''
requirements:
page: '\d+'
type: '\d+'
area: '\d+'
aspects:
page: { type: StaticRangeMapper, start: '1', end: '100' }
page-label: { type: LocaleModifier, default: 'page-', localeMap: [{ locale: 'en_.*', value: 'page-' }, { locale: 'de_.*', value: 'seite-' }] }
company_slug: { type: 'PersistedAliasMapper', tableName: 'tt_address', routeFieldName: 'slug' }
plugin_slug: { type: 'PersistedAliasMapper', tableName: 'tx_myextkey_domain_model_plugin', routeFieldName: 'slug' }
type-label: { type: LocaleModifier, default: 'type-', localeMap: [] }
area-label: { type: LocaleModifier, default: 'area-', localeMap: [] }