I got a method that should be used via blocks and modules, where should I put it,
do I need to require it in each class that uses it or there is a place moodle will automatically load and it’s meant to use for this kind of cases? I’m looking for best practice.
I got a method that should be used via blocks and modules, where should
Share
There’s no official place for common third party libraries like that, but you could use the /local folder, which is as close as you’ll get. Documentation here explains how to make a local plugin, which in your case needs to be non-functional, so just have a basic version.php file and lib.php with your stuff in it. Your module and block can then use require_once() to make sure the lib.php file from /local is included.