[TYPO3-mvc] UriBuilder

Claus Due claus at wildside.dk
Wed Feb 6 09:50:51 CET 2013


Hi Stefan,

> How can I make links with the uriBuilder? I try it but I don't get it. Could
> pls someone give me short example?

$link = $this->uriBuilder->uriFor('actionname', 'ControllerName', 'PluginName', $optionalArgumentsArray);

Supports chaining:

$link = $this->uriBuilder->setTargetPageType(1234567)->uriFor(…);

Manual building:

$link = $this->uriBuilder->setArguments($argumentsAsArrayWithPluginScope)->build();

After building, in case you don't want / can't use traditional Extbase redirection:

$this->redirectToUri($link);

I _highly_ recommend reading the source code of class:

Tx_Extbase_MVC_Web_Routing_UriBuilder

It has doc comments for every building method with examples for many of them. Much more detail than I can write here ;)

Cheers,
Claus


More information about the TYPO3-project-typo3v4mvc mailing list