TYPO3 条件插件上的 Symfony 表达式语言

TYPO3 condition Symfony Expression language on plugin

我如何用 Symfony 表达式语言编写这种旧式打字错误条件?

[globalVar = GP:tx_myext_myplugin|bla > 0]

也许像

[request.getQueryParams()['tx_myext_myplugin[bla]'] > 0]

但这显然行不通。

[(request.getQueryParams()['tx_myext_myplugin'])['bla'] > 0]

如果它在日志中产生错误,那么您需要像这样检查..(即无法获取非数组上的项目)

[request.getQueryParams() and
request.getQueryParams()['tx_myext_myplugin'] and
request.getQueryParams()['tx_myext_myplugin']['bla'] > 0]

//Typoscript Code

[end]

&& can also be used as conditional operator here

旧式 TypoScript 条件 [globalVar = GP:tx_myext_myplugin|bla > 0] 可以用新的条件语法编写,例如 [traverse(request.getQueryParams(), 'tx_myext_myplugin/bla') > 0]

结合使用 traversegetQueryParamsavoid errors in case a key in the parameter array is not defined