I'm sure I read somewhere that developers should not use locallib.php anymore but rather prefer using classes for local functions.
Eg if I want to set some options for display of an item I could add that to, say, myplugin/classes/displayoptions.php or some suitable sub-folder.
However, in example code I see locallib.php used frequently.
Any advice on when to use which would be welcome.
That's a good point. I believe that page is the current info.
A quick search of the wiki for "locallib.php" suggests that these pages need updating to reflect current best practice:
I'll do a quick update of these page while I'm at it, any improvements on what I write are welcome!
This might be something that could be added?
I have data handling functions and utilities for my sub-tables of an activity module (like saving and updating them). I want to put these in functions (classes?) if I feel they are too complex or long to go in the editing page.
Are there naming conventions like all db handling methods go into one sub-folder (or page) and utilities in another?
Or is that up to the individual developer just to use common sense?
If you are going to use a subfolder, then, to avoid clashes with future core Moodle class namespaces (e.g. the 'task' and 'event' subfolders), you should create your subfolders inside 'local', e.g. myplugin/classes/local/blah - after that, you're free to do what you want (and note that the use of 'local' is not enforced, just encouraged).
Any idea when the example github repo (https://github.com/moodlehq/moodle-mod_newmodule) will be updated to reflect how plugins should be developed?
I'd like to start working on an xapi/cmi5 activity module and am getting a bit lost in the Moodle docs.
P.S. I've got a background in documentation. If someone can point me to scratch notes and/or provide a tutorial via webconference (I'll pay), I can update the docs.