当它运行时,检查传递给函数的$setting参数。
my_cforms_logic 在几个不同的挂钩上调用,其中一些挂钩几乎同时运行。
###
### Your custom application logic features
###
### "successMessage" $cformsdata = cforms datablock
### "redirection" $cformsdata = cforms datablock
### "filename" $cformsdata = $_REQUEST
### "adminTO" $cformsdata = cforms datablock
### "nextForm" $cformsdata = cforms datablock
###
### "adminEmailTXT" $cformsdata = cforms datablock
### "adminEmailHTML" $cformsdata = cforms datablock
### "autoConfTXT" $cformsdata = cforms datablock
### "autoConfHTML" $cformsdata = cforms datablock
###
如果只想在其中一个钩子上运行自定义函数,请说“successMessage”,然后按如下方式启动函数:
function my_cforms_logic($cformsdata,$oldvalue,$setting) {
if (\'successMessage\' != $setting) return $oldvalue;
// now, do your custom logic
// [. . . ]
}
有趣的是,我前几天才弄明白。