So here is what i got yet, but now i´m stuck and don´t know how to save the data.
I added a hook snippet "formit2db"
[[!FormIt?
&hooks=`spam,formit2db,email`
&emailTpl=`myEmailChunk`
&emailTo=`[email protected]`
]]
<?php
$errorMsg = '<pre>'.print_r($scriptProperties['fields'],true).'</pre>';
$scriptProperties['hook']->errors['user'] = $errorMsg;
$dsn= 'mysql:host='.$modx->db->config['host'].';dbname=regenata';
$xpdo= new xPDO($dsn, $modx->db->config['user'], $modx->db->config['pass']);
/**
* Adding our package
*/
$xpdo->addPackage('mypackage','/path/to/mypackage/model/','mp_');
return true;
?>
at the part with addPackage i don´t know what to do or if it is the right way.
I think now i have to create a XML-File for the database model?
I am not so experienced with MVC programming:(
So has anyone a solution for me?