[Typo3-dev] clean typo-link function

Luite van Zelst luite at aegee.org
Sun Sep 28 21:54:08 CEST 2003


Hi Sacha,

>> I`m trying to write a function that generates clean typo links in 
>> extensions. I want to use it with tt_products (replacement for 
>> getLinkUrl). I`ve read Luites FAQs on typo3.org but I couldn`t get his 
>> function to work + it was missing some features so I decided to write 
>> my own function.
>>
>> Could you please have a look at it and tell me how to make this 
>> function or Luites function work as a replacement for the old 
>> getLinkUrl function in tt_products?
>>
>> Here`s my try:
>>
>> http://www.wunderkessel.de/download/linkgen.txt
>>
> 
> pi_getPageLink($this->$var_with_the_uid_in,"","");
> 
> is one pretty good function for giving you clean links have a look in 
> class.tslib_pibase.php

yes, it probably is. but it all depends on what "featurs" you want for 
your function.

some questions first:

*) where is is function being called from? an extension (extends 
tslib_pibase)? If so, why instantiate a new cobj, and not use $this->cObj

*) why use "current" if you set it first, in stead of setting the 
parameter directly?

*)what do you mean with "create only pagename with parameters"?

*) what other features / what do you mean by "don't get it to work", I 
mean: what output do you get then?

*) if this is for an extension, why not use $this->piVars (which 
corresponds to (more or less) array_merge($_POST['your_ext_pi1'], 
$_GET['your_ext_pi1']) and thus to <input name="your_ext_pi1[myfield]"> etc)
putting *all* the post and get variables to create the links seems a bit 
drastic. furthermore, if a parameter is in both get and post, it's added 
twice. I'd merge the arrays first, and then do one loop for both.

cherio,
Luite







More information about the TYPO3-dev mailing list