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

Development:lib/weblib.php moodle url: Difference between revisions

From MoodleDocs
No edit summary
 
No edit summary
Line 10: Line 10:
** output the url without any get params  
** output the url without any get params  
** and output the params as hidden fields to be output within a form
** and output the params as hidden fields to be output within a form
[[Category:Developer]]

Revision as of 10:53, 20 May 2007

Moodle1.9


moodle_url is a new class available from Moodle 1.9 onwards in weblib.php. It can be used in moodle pages where config.php has been included without any further includes.

It is useful for manipulating urls with long lists of params. One situation where it will be useful is a page which links to itself to perfrom various actions and / or to process form data. A moodle_url object :

  • can be created for a page to refer to itself with all the proper get params being passed from page call to page call
  • and methods can be used to output a url including all the params, optionally adding and overriding params
  • and can also be used to
    • output the url without any get params
    • and output the params as hidden fields to be output within a form