summaryrefslogtreecommitdiffstats
path: root/lib/SimpleSAML/Module.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/SimpleSAML/Module.php')
-rw-r--r--lib/SimpleSAML/Module.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/SimpleSAML/Module.php b/lib/SimpleSAML/Module.php
index b61ec2d..f626bbd 100644
--- a/lib/SimpleSAML/Module.php
+++ b/lib/SimpleSAML/Module.php
@@ -136,14 +136,19 @@ class SimpleSAML_Module {
* This function creates an absolute URL to a resource stored under ".../modules/<module>/www/".
*
* @param string $resource Resource path, on the form "<module name>/<resource>"
+ * @param array $parameters Extra parameters which should be added to the URL. Optional.
* @return string The absolute URL to the given resource.
*/
- public static function getModuleURL($resource) {
+ public static function getModuleURL($resource, array $parameters = array()) {
assert('is_string($resource)');
assert('$resource[0] !== "/"');
$config = SimpleSAML_Configuration::getInstance();
- return SimpleSAML_Utilities::selfURLhost() . '/' . $config->getBaseURL() . 'module.php/' . $resource;
+ $url = SimpleSAML_Utilities::selfURLhost() . '/' . $config->getBaseURL() . 'module.php/' . $resource;
+ if (!empty($parameters)) {
+ $url = SimpleSAML_Utilities::addURLparameter($url, $parameters);
+ }
+ return $url;
}