[TYPO3-mvc] URIBuilder rewrite

Bastian Waidelich bastian at typo3.org
Wed Aug 12 11:11:49 CEST 2009


Jochen Rau wrote:

>> and then keep all arguments within the "namespace" of the current plugin
>> (tx_yourext_yourplugin)?
> 
> Hmm. Maybe we have to omit "Plugin" not to offend the backend crew ;-).

Well, we have pluginName as parameter anyways..


> What about setKeepArguments(boolean) with a good documentation?

That's what setAddQueryString(boolean) does (and it would overrule the 
pi_linkTP_keepPIvars setting).

pi_linkTP_keepPIvars only keeps the arguments of the current plugin.

An alternative would be an optional second parameter in 
setAddQueryString(boolean, array) specifying the "namespaces" to keep..
But then again, setters should be silly, right Steffen? ;)

Maybe keepArgumentsOfNamespaces(array('tx_myext_pi1', 'tx_myext_pi2'));

That would be even more powerful.. But, do we need it or is 
setAddQueryString(TRUE) enough?


> Furthermore, the Arguments should be overwritten by the arguments set in 
> uriFor('someAction', array('some' => 'argument')).

I've called the arguments of the uriFor method "controllerArguments" 
cause those will be namespaced with extensionName/packageKey and 
pluginName/subPackageKey.
But yeah:

$uriBuilder
	->setArguments(array('foo' => 'bar', 'tx_myext_pi1' => array('someKey' 
=> 'someValue', 'someOtherKey' => 'someValue'))
	->uriFor('action', array('someKey' => 'overwritten'))

should return
?foo=bar&tx_myext_pi1[someKey]=overwritten&tx_myext_pi1[someOtherKey]=someValue

Is that what you mean?
Bastian


More information about the TYPO3-project-typo3v4mvc mailing list