Mailformplus (tx mailformplus)

Aus Wikizone
Version vom 18. November 2006, 14:35 Uhr von 84.160.199.16 (Diskussion)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche

Post processing der Formularfelder

Hook for post-processing submitted fields

(available since 3.7, thx to Martin Kutschker)

This hook gives you the possibility to save or process the submitted fields after the form was successfully submitted.

Standard mailformplus functionality like sending mail(s) or inserting records are not influenced by this hook.

how to use the hook:

  • define a user-function which will do the processing
  • create a php file with a class and function which will be called when the form was submitted:

example:

class.tx_myext.php

content:

class tx_myext {
function doit(&$params, &$ref){
......
}
}

The variable $params will hold the following values:

$params[config] ... config variables passed via TypoScript: example: saveUserFunc.dummy = hello can be accessed by $params[config][dummy]

$params[data] ... all submitted GET and POST variables merged

activate the hook with TypoScript

You have to define the user function that should be called when the form was submitted correctly:

plugin.tx_thmailformplus_pi1.saveUserFunc = EXT:myext/class.tx_myext.php:tx_myext->doit

You can also define “variables” which will be passed to the user function:

plugin.tx_thmailformplus_pi1.saveUserFunc.dummy = hello