【发布时间】:2021-06-24 15:41:45
【问题描述】:
我只是想在我的page.typoscript 文件中使用 PHP 代码以编程方式计算一个值。这就是我所做的:
dataProcessing {
1010 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
1010 {
levels = 2
special = directory
special.value = USER_INT
special.value {
userFunc = Vendor\Extension\Utils\NavigationBarUtils->getPlatformRootPid
}
as = menuMain
}
...
}
调用的方法就是这个:
public function getPlatformRootPid(): int
{
return 1;
}
当我加载任何页面时,menuMain 为空。命名空间是正确的。另外,我使用这样的方法来计算同一个 page.typoscript 文件中的一些其他值,并且它们可以工作。
当将该值设置为special.value = 1 时,它会按预期工作。
MenuProcessor(即 HMENU)special.value 和 USER_INT 是否有问题?它们是否以某种方式不兼容?还是我在这里遗漏了什么?
非常感谢您!
【问题讨论】:
标签: php typo3 typoscript