[TYPO3-mvc] URIBuilder rewrite

Bastian Waidelich bastian at typo3.org
Tue Aug 11 22:18:50 CEST 2009


Sebastian Kurfürst wrote:

Hi Sebastian

> don't you still need some way to "reset" all settings to their default 
> values?

Not, unless the UriBuilder was a singleton. You'd reuse the same builder 
in order to keep the settings, or you would create a new instance.

Nonsense-example:

$postDetailsUri = 
t3lib_div::makeInstance('Tx_Extbase_MVC_Web_Routing_UriBuilder');
$postDetailsUri->setTargetPageUid($this->settings['postDetailsPID'])

$postListUri = 
t3lib_div::makeInstance('Tx_Extbase_MVC_Web_Routing_UriBuilder');
$postListUri
	->setTargetPageUid($this->settings['postListPID'])
	->setNoCache(TRUE);


echo '<a href="' . $postListUri->render() . '">show list</a>';
foreach($posts as $post) {
	$postDetailsUri->setArguments(array('postUid' => $post['uid']));
	echo '<a href="' . $postDetailsUri->render() . '">' . $post['title'] . 
'</a>';
}

In Fluids uri/link viewhelpers we might re-use the same UriBuilder to 
reduce memory consumption. But there we have to set all available 
settings each time anyways.

Apart from that, what is your impression?

Bastian


More information about the TYPO3-project-typo3v4mvc mailing list