Learning to use hooks
Posted: 2021-08-26 15:15
I am new to using hooks in Appgini and I have some questions. I have this code in the file /hooks/duck-season-2015.php:
I added the "echo "<script>alert('folder2');</script>";" to this event just to see when this event fires. It is not working here but I have tried this code in other parts of my app and it works ok there.
Questions:
1- Should this code work here or am I doing something wrong?
2 - Do I need to supply the parameters, i.e. &$data, $memberInfo, &$args, in order to make this work? If so, what would their values look like?
3 - In a related way, how can I past the value of a variable in one page to code in another page?
Thanks,
TD
Code: Select all
function duck_season_2015_before_insert(&$data, $memberInfo, &$args) {
echo "<script>alert('folder2');</script>";
return TRUE;
}
Questions:
1- Should this code work here or am I doing something wrong?
2 - Do I need to supply the parameters, i.e. &$data, $memberInfo, &$args, in order to make this work? If so, what would their values look like?
3 - In a related way, how can I past the value of a variable in one page to code in another page?
Thanks,
TD