Im Prinzip legst du ein neues Modul an, darin 2 Datein, config und die Klasse mit der Logik.
Beispiel:
/system/modules/myCustomModule/config/config.php:
PHP-Code:
$GLOBALS['TL_HOOKS']['createNewUser'][] = array('myCustomModuleClass', 'myCustomClassMethod'); // Klassenname - Methodenname
/system/modules/myCustomModule/myCustomModuleClass.php:
PHP-Code:
class myCustomModuleClass // Klassenname = Dateiname (ohne .php)
{
public function __construct() {} // eventuell nicht nötig, probieren
public function myCustomClassMethod($intId, $arrData) // Methodenname so wie in config angegeben, Parameterdefinitionen aus dem Entwicklerhandbuch entnehmen
{
print_r($intId); // Print the ID of the new User
print_r($arrData); // Print out the user's data, which should include the fields you need.
}
}
Ansonsten, immer gute Sache, schaue im Core ob dort der Hook irgendwo schon mal genutzt wird.
Je nach Hook ist es nötig (bzw. vereinfacht das ganze), dass die Klasse von Frontend, Backend, Module, System o.ä. erbt.
Lesezeichen