]> git.mjollnir.org Git - moodle.git/commitdiff
added a param to moodle_url constructor to provide params as an array just as a conve...
authorjamiesensei <jamiesensei>
Fri, 4 May 2007 05:45:33 +0000 (05:45 +0000)
committerjamiesensei <jamiesensei>
Fri, 4 May 2007 05:45:33 +0000 (05:45 +0000)
lib/weblib.php

index 4e6d3c6985885aef693f727687aa6c223abdb340..bde9151aa8e337e03c16fbff0d0e5bdab6fc1679 100644 (file)
@@ -300,9 +300,12 @@ class moodle_url {
     /**
      * Pass no arguments to create a url that refers to this page. Use empty string to create empty url.
      * 
-     * @param string $url url
+     * @param string $url url default null means use this page url with no query string
+     *                      empty string means empty url.
+     *                      if you pass any other type of url it will be parsed into it's bits, including query string
+     * @param array $params these params override anything in the query string where params have the same name.
      */
-    function moodle_url($url = null){
+    function moodle_url($url = null, $params = array()){
         global $FULLME;
         if ($url !== ''){
             if ($url === null){
@@ -319,6 +322,7 @@ class moodle_url {
             foreach ($parts as $key => $value){
                 $this->$key = $value;
             }
+            $this->params($params); 
         }
     }    
     /**