Project

General

Profile

Actions

Feature #15117

closed

tslib_cObj -> getTypoLink does not support arrays

Added by Daniel Kyak about 19 years ago. Updated about 13 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2005-10-19
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

The getTypoLink does not support arrays in the urlParameter.

So you can't get Typo3Links links this:

http://mydomain.de/index.php?id=1170&select[]=1325&select[]=1335&select[]=1345

The solution could be look like this:

function getTypoLink($label,$params,$urlParameters=array(),$target='')    {
$conf=array();
$conf['parameter'] = $params;
if ($target) {
$conf['target']=$target;
$conf['extTarget']=$target;
}
if (is_array($urlParameters)) {
if (count($urlParameters)) {
reset($urlParameters);
while(list($k,$v)=each($urlParameters)) {
if (is_array($v)) {
reset($v);
while (list(,$v2) = each($v)) {
$conf['additionalParams'].='&'.$k.'[]='.rawurlencode($v2);
}
} else {
$conf['additionalParams'].='&'.$k.'='.rawurlencode($v);
}
}
}
} else {
$conf['additionalParams'].=$urlParameters;
}
$out = $this->typolink($label,$conf);
return $out;
}

(issue imported from #M1681)

Actions

Also available in: Atom PDF