[TYPO3-mvc] controller and unique id
Bastian Waidelich
bastian at typo3.org
Mon Jul 20 10:42:50 CEST 2009
Steffen Kamper wrote:
Hi Steffen,
> when inserting more than one plugin on one page there is the need of an
> unique identifier.
Good, that you bring up this topic. The prefixing is not yet elaborate
in fluid & extbase (neither in FLOW3).
> the controller could create an own with uniqid()
The problem is, that sometimes you want to share the _same_ namespace
across multiple controllers. And you wouldn't want to use the tt_content
uid by default as the details view might be on a different page...
So I think, we need a more flexible approach here.
what about using 'tx_myextension_mycontroller' as default namespace that
can be overridden in controller _and_ link/form view helpers?
Something like:
// in the controller
protected $defaultUriNamespace = 'tx_myextension_foo';
// in the template
<f:link.action action="foo" /> ==> <a
href="index.php?id=123&tx_myextension_foo[action]=foo&.."
<f:link.action action="foo" controller="otherController" /> ==> <a
href="index.php?id=123&tx_myextension_othercontroller[action]=foo&..."
<f:link.action action="foo" uriNamespace="tx_myextension_bar" /> ==> <a
href="index.php?id=123&tx_myextension_bar[action]=foo&.."
uriNamespace is definitely not the best name, but you get the point.
What do you think?
Bastian
More information about the TYPO3-project-typo3v4mvc
mailing list