Note: You are currently viewing documentation for Moodle 3.2. Up-to-date documentation for the latest stable version of Moodle is probably available here: Developer FAQ.

Development:Developer FAQ: Difference between revisions

From MoodleDocs
No edit summary
 
No edit summary
Line 12: Line 12:


Always use the "datalib" functions, such as insert_record() or get_record(). Look at [http://moodle.sourceforge.net/dhawes-phpdoc/moodlecore/_lib_datalib_php.html the documentation for datalib.php] for more functions and details of use.
Always use the "datalib" functions, such as insert_record() or get_record(). Look at [http://moodle.sourceforge.net/dhawes-phpdoc/moodlecore/_lib_datalib_php.html the documentation for datalib.php] for more functions and details of use.
===How do I get/set configuration settings?===
...

Revision as of 11:03, 5 April 2006

How to get/set information when writing new Moodle code

How do I find out the currently-logged-on user?

The global object $USER, which contains the numeric $USER->id among other things.

How do I find out the current course?

...

How do I insert/retrieve records in the database, without creating my own database connections?

Always use the "datalib" functions, such as insert_record() or get_record(). Look at the documentation for datalib.php for more functions and details of use.

How do I get/set configuration settings?

...