summaryrefslogtreecommitdiffstats
path: root/lib/SimpleSAML/Module.php
diff options
context:
space:
mode:
authorOlav Morken <olav.morken@uninett.no>2009-12-16 14:08:37 +0000
committerOlav Morken <olav.morken@uninett.no>2009-12-16 14:08:37 +0000
commit0b22213ce238c181618836a7979c13d675808b71 (patch)
treeca17db74d7757dbfc5c12fefba3020394945c287 /lib/SimpleSAML/Module.php
parentc00a31176b8080ed7eb4e48357fd6dce1dfa8b3a (diff)
downloadsimplesamlphp-0b22213ce238c181618836a7979c13d675808b71.zip
simplesamlphp-0b22213ce238c181618836a7979c13d675808b71.tar.gz
simplesamlphp-0b22213ce238c181618836a7979c13d675808b71.tar.bz2
Module::getModuleURL: Add $parameters parameter.
git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2054 44740490-163a-0410-bde0-09ae8108e29a
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;
}