如何在Typolinkwrap中向URL添加参数


how to add parameter to url in typolinkwrap?

我使用以下代码在标记中显示链接:

    $this->wrappedSubpartArray['###mMY_TEMPLATEMARKER###']=$this->cObj->typolinkWrap( array('parameter' => ($this->conf['single.']['pid'] > 0 ? $this->conf['single.']['pid'] : $GLOBALS['TSFE']->id), 'additionalParams' => '&' . $this->prefixId . '[show]=' . $rowArray[($this->piVars['pointer'] > 0 ? $this->piVars['pointer'] : 0)][$i]['uid'], 'useCacheHash' => 1) ); // Shows Detail Link

我想添加参数

'&type=250' 

最后,但它只是不会出现或 &丢失。

多么丑陋的符号!! :S

Typolink 将额外的 Params 作为字符串&param1=val1&param2=val所以只需将您想要的内容入其中(请注意,它总是使用 & 个字符作为参数,即使是第一个):

$arr = array(
    'parameter' => ($this->conf['single.']['pid'] > 0 ? $this->conf['single.']['pid'] : $GLOBALS['TSFE']->id),
    'additionalParams' => '&' . $this->prefixId . '[show]=' . $rowArray[($this->piVars['pointer'] > 0 ? $this->piVars['pointer'] : 0)][$i]['uid'] . '&type=250', // <- here
    'useCacheHash' => 1);
$this->wrappedSubpartArray['###mMY_TEMPLATEMARKER###'] 
                          = $this->cObj->typolinkWrap($arr);