From: jamiesensei Date: Fri, 4 May 2007 05:45:33 +0000 (+0000) Subject: added a param to moodle_url constructor to provide params as an array just as a conve... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e744ebba7bea7550202da95332554aa4591943b6;p=moodle.git added a param to moodle_url constructor to provide params as an array just as a convenience to quickly construct a url with an array of params. --- diff --git a/lib/weblib.php b/lib/weblib.php index 4e6d3c6985..bde9151aa8 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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); } } /**