[TYPO3-english] Create a full url with TYPO3

Jigal van Hemert jigal at xs4all.nl
Tue Jan 3 18:05:27 CET 2012


Hi,

On 3-1-2012 15:23, Iban Cardona i Subiela wrote:
> I'd like to create a url in format "http://www.google.com" using some
> TYPO3 function similar to "pi_getPageLink".
> Do you know if there is any feature?

Why not use the mother of all link functions: tslib_cObj::typolink()

In your pibase extension it's available through
$this->cObj->typolink($linkText, $configuration);

Configuration can be found in TSref for the TypoScript typolink property 
but then in an array form:
$configuration = array(
   'parameter' => 23,
   'additionalParams' => '&tx_myext_pi1[myvar]=' . intval($myvar),
   'forceAbsoluteUrl' => 1,
   'returnLast' => 'url'
);

If you need to set sub-properties make sure the property above ends with 
a dot:
   'additionalParams.' => array(
     'insertData' => 1,
   )

So typolink.additionalParams.insertData = 1 becomes
$configuration['additionalParams.']['insertData'] = 1;

Now you can use forceAbsoluteUrl to create a complete url as you want.

-- 
Kind regards / met vriendelijke groet,

Jigal van Hemert.


More information about the TYPO3-english mailing list