Fluid f:form deactivate referrer fields

The FormViewHelper adds a lot of hidden referrer fields to a form, which can be annoying, especially if you want to submit a form via GET. To remove these fields, it is possible to create a custom viewhelper that extends fluids FormViewHelper. We call it like this:

{namespace ophi=Ophi\OphiExtension\ViewHelpers}

<ophi:form action="something" method="GET">...</ophi:form>

And the ViewHelper looks like this:

<?php

namespace Ophi\OphiExtension\ViewHelpers;

class FormViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper {
    protected function renderHiddenReferrerFields(){
        return '';
    }
}

That is enough. Maybe TYPO3 will revolt with some configurations, but for me it worked right away.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.