Note: You are currently viewing documentation for Moodle 3.3. Up-to-date documentation for the latest stable version of Moodle is probably available here: lib/weblib.php.

Development:lib/weblib.php

From MoodleDocs
Revision as of 14:18, 10 October 2007 by Tim Hunt (talk | contribs)

This library is largely concerned with generating output.

There are lots of different things in this library, and so far, only a very few parts have been documented. However, remember:

  • The code should be well written and easy to understand. Want to know what a particular function does? Well, read the code. Unlike documentation, the code does not get out of date.
  • The generated phpDocumentor output should give brief details about each function.

Documentation of particular bits

function build_navigation

You need to call this function before calling print_header(_simple) to create the $navigation parameter.

Typical usage example:

From mod/quiz/attempt.php:
        $navlinks = array();
        $navlinks[] = array('name' => $strattemptnum, 'link' => '', 'type' => 'title');
        $navigation = build_navigation($navlinks, $cm);

        print_header_simple(format_string($quiz->name), "", $navigation, ... )

See also