Skip to content
Snippets Groups Projects
Commit 0b22213c authored by Olav Morken's avatar Olav Morken
Browse files

Module::getModuleURL: Add $parameters parameter.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2054 44740490-163a-0410-bde0-09ae8108e29a
parent c00a3117
No related branches found
No related tags found
No related merge requests found
...@@ -136,14 +136,19 @@ class SimpleSAML_Module { ...@@ -136,14 +136,19 @@ class SimpleSAML_Module {
* This function creates an absolute URL to a resource stored under ".../modules/<module>/www/". * 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 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. * @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('is_string($resource)');
assert('$resource[0] !== "/"'); assert('$resource[0] !== "/"');
$config = SimpleSAML_Configuration::getInstance(); $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;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment