onizukaek
onizukaek

Reputation: 1233

Convert typo3 internal url to external url

I've been looking for the way to convert the typo3 internal urls whose format is t3://page?uid=xx to a human readable url http://mydomain/page-slug.

I'd want to do the same thing that the ViewHelper link.typolink does but in the php context (outside of the Extbase context, I'm not in a controller). The context is that I am gettind a link from a db to send it to an external API. I tried to look for documentation but all helpers are about generating an url from controller name and action, etc...

Can somebody please explain what is the proper way to do it? The typo3 version I use is the 11.5.

Thanks for your answers.

Upvotes: 0

Views: 477

Answers (1)

onizukaek
onizukaek

Reputation: 1233

Actually a content was needed but I had no clue which value to set in it and... I found it, in the cObject, there is the method

typoLink_URL($conf)

That takes the same parameter as stdWrap_typolink, calls the typolink method as well but with the $content variable already set which in this case is a pipe |.

So you only need to call it so:

$this->cObj->typoLink_URL(['parameter' => $typoLink]);

And you have your url.

Thank you for your help Julian.

Upvotes: 1

Related Questions