General developer forum

Problems with locallib.php file

 
Picture of Karen Holland
Re: Problems with locallib.php file
Moodle HQParticularly helpful MoodlersPlugin developersTesters

Hi Saúl, good luck with your plugin development!

I'd suggest including your files with the following:

$ require_once(__DIR__.'/nameoffile.php');

This is a standard Moodle way of defining the current directory's relative pathway, used in many areas (you can grep the core code for examples).

Also check out https://docs.moodle.org/dev/Coding_style at the "Require / include" section for more details.

https://docs.moodle.org/dev/Blocks and https://docs.moodle.org/dev/Activity_modules is also excellent for an introduction to moodle plugin development

Also I'd highly recommend Moodle 3.1 LTS modules development by Tomasz Muras, very comprehensive clear explanations and very readable.

 
Average of ratings: -