Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

User talk:Richard Jones

From MoodleDocs

Hi Richard,

Sorry for not getting back to you sooner. I spotted the e-mail notifications the first time, and missed them the second time. In terms of learning Moodle development, the documentation was even worse when I got started, so some of my code that dates from back then is pretty horrendous. I'm re-working my own block at the moment, and I was determined to do things correctly this time, so I've spent an ungodly amount of time reading code and finding info on the forums.

As a result, I'm going around trying to improve bits of the developer documentation, but to be honest my best friend when it comes to Moodle development has always been PHPXref, which has let me surf through the source code easily. More recently, NetBeans has added Git support, so I switch to whichever Moodle version I'm working on from within NetBeans and let the IDE index it. With something this big and with a history of fairly poor developer documentation, you've got to be prepared to get your hands dirty. Anything added since Moodle 2.0 tends to have much better documentation, but stuff that's been around a while is not nearly as good. I'm planning to write more docs on timezones, database access, the web output library, etc.

Not sure what you're wanting to do with your code, but areas like XMLDB, installation, upgrade, etc are very well documented. Output suffers more, and the more esoteric functions you'll just stumble across one day in someone else's code and think "ah, right!" If you're going to read through any particular pieces of code, I highly recommend becoming more familiar with:

/lib/dml/moodle_database.php
This forms the basis of the $DB global object. Lots of useful methods in there.
/lib/formslib.php
You'll almost certainly need this at some point. Handles forms well, once you get the hang of it
/lib/pagelib.php
/lib/weblib.php
/lib/outputrenderers.php
/lib/outputrequirementslib.php
These four what you'll need for output, and it amazes me that their documentation is so bad. Definitely on my hitlist.
/lib/tabelib.php
Don't know how much you use tables, but I use them all the time.


See you in the developer forums. ;-)

Greg J Preece