我使用RealUrl作为我的网站。在我的特定扩展中,我需要将RealUrl创建的url解码为普通的TYPO3 url格式。
示例:
到我的控制器,我得到了以下链接:typo3website/feature/number/123,现在如何将其转换为typo3website/index.php?id=99&number=123
RealUrl不使用命名空间,因此我无法理解如何创建类tx_realurl的实例。
我尝试使用require_once(PATH_typo3conf.'ext/realurl'.'/class.tx_realurl.php');并创建tx_realurl的新实例,但是给出了一个未找到的错误类。
发布于 2013-11-29 12:20:01
如果RealURL配置正确,并且使用uriBuilder或ActionViewHelper生成链接,则不需要处理这个问题。如果我们以您的示例为例,并将RealURL配置为使用typo3website/feature/number/123 for index.php?id=99&tx_yourext[number]=123,则可以将其用作操作的参数:
public function showAction($number) {
}还可以通过以下方法访问控制器操作中的所有参数
$this->request->getArguments()https://stackoverflow.com/questions/20283970
复制相似问题