[TYPO3-mvc] UriBuilder with realurl in CLI mode

Steffen Ritter info at rs-websystems.de
Mon Aug 8 15:34:13 CEST 2011


Am 04.08.2011 11:04, schrieb Michael Grundkötter:
> Hi.
>
> I have a problem using the uri builder in an extbase controller I call from CLI. The controller is called via normal bootstrap stuff and the TS config for the FE of the website is loaded correctly already. The problem is, the uri builder does not care about realurl settings and returns a (relative) url with normal parameters.
>
> The code looks like this:
>
> $this->uriBuilder->setCreateAbsoluteUri(true);
> $this->uriBuilder->setTargetPageUid(123);
> $this->uriBuilder->setArguments(array('xxx' =>  yyy));
> $this->uriBuilder->buildFrontendUri();
>
> Creates something like: ?id=123&xxx=yyy&cHash=xyz
> Should be like this: http://www.myDomain.de/de/my-page-name/xxx/yyy.html
>
> Does anybody know how to get the uri builder to use realurl settings in such a scenario?
>
> The solution right now is to prefix the returned url with the TS baseurl config afterwards which does work but the link in the mail still looks pretty ugly.
>
> TYPO3 version is 4.5.4
>
> THX for any hints on that :-)
> Michael

You need to initialize aprts of TSFE via CLI :)
Therefore I wrote my own Bootstrap, overwriting some Parts of the 
"normal" extbase Bootstrap. Therefore you have to pass the Id of the 
page which "TS-Configuration should be used..."

After Creating the Bootstrap object you just can "work as if you are in 
an controller action" :)

regards

Steffen


More information about the TYPO3-project-typo3v4mvc mailing list