Closed alexandru-elisei closed 8 years ago
Do not overvalue the documentation. Whenever you're in doubts, refer to the source code itself. In this particular case, https://github.com/moodle/moodle/blob/6c1342d7e5ca909a0ddd60661b59ba11f9ea4d4d/course/modlib.php#L119-L124 shows that this callback really accepts two parameters. But most modules do not need access to the form so they do not have it present in the signature.
For the purpose of your generator, I suggest to generate the template with both parameters present and documented.
Yes, I had decided to use two parameters and not follow the documentation.
EDIT: closing the issue.
The documentation is here.
I am confused. The documentation has one prototype of the function
function certificate_add_instance($certificate);
but in some mod plugins I've seen a different prototype:function <mod>_add_instance($data, $mform)
.What is the correct form? Are both possible and I should have this as an option?