[TYPO3-mvc] switchableControllerActions and f:link.action
Stephan Reuther - development.IT
s.reuther at internet-chemnitz.de
Thu Apr 29 13:47:17 CEST 2010
Hi Cornelius,
Zitat von Cornelius Illi <cornelius.illi at student.hpi.uni-potsdam.de>:
> Then I could create a details-page, but <f:link.page
> additionalParams="{ plugin[myVar] : 1234 }"> does not accept nested
> vars.
> if($this->request->hasArgument("action") ) {
> if($this->request->getArgument("action") == "view")
> return $this->forward("view");
> }
>
> Is there a better solution?
indeed, there is :)
please have a look at examples in LinkViewHelper.php
http://forge.typo3.org/repositories/entry/typo3v4-mvc/fluid/trunk/Classes/ViewHelpers/Link/PageViewHelper.php
<code title="query parameters for extensions">
<f:link.page pageUid="1" additionalParams="{extension_key: {foo:
'bar'}}">page link</f:link.page>
</code>
Output:
<a href="index.php?id=1&extension_key[foo]=bar">page link</f:link.action>
(depending on your TS configuration)
your approach is nearbythe way it is done here, use additionalParas this way:
{extension_key: {myVar : 1234 }}
and it will work.
stephan
More information about the TYPO3-project-typo3v4mvc
mailing list