mudrd8mz / moodle-tool_pluginskel

Generator of Moodle plugins skeletons
https://moodle.org/plugins/tool_pluginskel
Other
51 stars 46 forks source link

Activity modules documentation #40

Closed alexandru-elisei closed 8 years ago

alexandru-elisei commented 8 years ago

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?

mudrd8mz commented 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.

alexandru-elisei commented 8 years ago

Yes, I had decided to use two parameters and not follow the documentation.

EDIT: closing the issue.