Project

General

Profile

Actions

Feature #15117

closed

tslib_cObj -> getTypoLink does not support arrays

Added by Daniel Kyak over 18 years ago. Updated over 12 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 #1

Updated by Not Only Pixel almost 14 years ago

Hi, there seems no need for this problem. Bug request is 5 years old. There are better solutions in the wild.

Actions #2

Updated by Dmitry Dulepov over 12 years ago

  • Status changed from New to Rejected
  • Target version deleted (0)
  • TYPO3 Version changed from 3.8.0 to 4.7
  • PHP Version deleted (4)

Use normal typoLink() and additionalParams together with implodeArrayForUrl.

Actions

Also available in: Atom PDF