[TYPO3-mvc] UriBuilder with realurl in CLI mode

Franz Koch typo3.RemoveForMessage at elements-net.de
Mon Aug 8 13:04:38 CEST 2011


Hey Michael,

> 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 UriBuilder is internally using typolink to build the uris - so if 
realUrl is not triggered in your case, I suppose your CLI context is 
most likely missing some TSFE stuff needed to get realURL working (don't 
ask me what exactly though).

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list