[英]TYPO3: DataHandler::setHistory() and typoLink_URL()
I would now like to 'combine' DataHandler::setHistory()
and typoLink_URL()
in order to get the URL of whatever has been changed. 现在,我想“组合” DataHandler::setHistory()
和typoLink_URL()
,以获取已更改内容的URL。
For a simple page, the below snippet does the trick: 对于一个简单的页面,下面的代码片段起到了作用:
$conf['parameter'] = 55;
typoLink_URL($conf);
To account for foreign languages, typoLink_URL requires an addition parameter: 要考虑外语,typoLink_URL需要一个附加参数:
$conf['additionalParams'] = '&L=2';
Also, the URL of a page created by a plugin may be retrieved via an additional parameter, such as: 此外,可以通过其他参数检索由插件创建的页面的URL,例如:
$conf['additionalParams'] = '&tx_ttnews[tt_news]=' . 2;
Is there a more generic way to get URLs? 是否有获取网址的更通用的方法? In other words, how do I find out the URL regardless of whether or not I know anything about the plugins installed? 换句话说,无论我是否对安装的插件一无所知,如何找到URL?
You get the URL of the current page. 您将获得当前页面的URL。 All the parameters will be given. 将给出所有参数。
$site_url = t3lib_div::getIndpEnv('TYPO3_REQUEST_URL');
You call could look like this: 您拨打的电话可能如下所示:
$conf['additionalParams'] = substr(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'),strlen(t3lib_div::getIndpEnv('TYPO3_SITE_URL')));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.