How to use Reflection and interfaces in Moodle module

Re: How to use Reflection and interfaces in Moodle module

by Tim Hunt -
Number of replies: 1
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Have a look a sub-plugins: https://docs.moodle.org/dev/Subplugins

That way, each algorithm would be a separate Moodle (sub-)plugins, and so Moodle will manage the install for you.

The only way that might not be good enough is if that is too heavy-weight. However, the overhead for people implementing new algorithms is only putting each class in a separate folder, with a version.php file.

Moodle has some useful helpers, like core_component::get_plugin_list_with_class, and these are backed by data stored in a cache, so are fast.

If that does not work for you, get back to us, and we can try thinking again.

Average of ratings: Useful (2)
In reply to Tim Hunt

Re: How to use Reflection and interfaces in Moodle module

by Zoran Jeremic -

Hi Tim,

Thank you so much for this suggestion. I think this is exactly what I need. Something similar I had in my mind, but I didn't know it's already supported in Moodle, so I started to implement my own settings and admin pages inside plugin. I'll switch to this approach as it looks much better.


Thanks,

Zoran