Use route in Link/ActionViewHelper in form template?

Hi at all,

I have overridden a form template as described here:

My template looks something like this:

{namespace form=TYPO3\Form\ViewHelpers}
<form:form action="index" object="{form}" method="post" id="{form.identifier}" enctype="multipart/form-data" class="form-horizontal">
    <form:renderRenderable renderable="{form.currentPage}" />
    <div class="actions">
        <f:render partial="Acme.Project:Navigation" arguments="{form: form}" />
        <f:link.action action="list" controller="MyController" package="Acme.Project" subpackage="Backend" class="btn btn-default">cancel</f:link.action>

Unfortunately the link.action ViewHelper doesn’t render my route as expected but like this:


Same, but better readable:


I have found out that in TYPO3\Flow\Mvc\Routing\UriBuilder class the namespace of the subrequest is added (which is “–myobject” in my case):

public function uriFor($actionName, $controllerArguments = array(), $controllerName = NULL, $packageKey = NULL, $subPackageKey = NULL) {
  // ...

   $controllerArguments = $this->addNamespaceToArguments($controllerArguments, $this->request);
   return $this->build($controllerArguments);

Is there a possibility to tell the link.action ViewHelper that it should not use the subrequest namespace?

Thanks in advance!

Hi Katharina

Did you try using the useParentRequest argument of the view helper?

Oh no! :smile:
I must have been blind!

Thank you for your quick answer! It works now.