[TYPO3-english] Re: How to hook TYPO3 Form submit

Chris Taylor chris at christaylordeveloper.co.uk
Sun Oct 29 06:50:50 CET 2017


I cannot get this to work.

My extension is made up of the two files below.  My extension does not appear in the Extension manager list.  When I try and zip my extension and import it I get an 'extension not available error'.  If I submit a form, nothing happens (I am expecting my die function to run).

How can I get this working please?

typo3conf/ext/myext/ext_localconf.php

<?php

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['afterSubmit'][time()] = \Chris\SomeSpace\FooHook::class;

typo3conf/ext/myext/Classes/Hook/FooHook.php

<?php

namespace Chris\SomeSpace;

class FooHook {

    public function afterSubmit(\TYPO3\CMS\Form\Domain\Runtime\FormRuntime $formRuntime, \TYPO3\CMS\Form\Domain\Model\Renderable\RenderableInterface $renderable, $elementValue, array $requestArguments = [])
    {
        die("this got called");
        return $elementValue;
    }
}


More information about the TYPO3-english mailing list