summaryrefslogtreecommitdiff
path: root/modules/rest/helpers/rest.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/rest/helpers/rest.php')
-rw-r--r--modules/rest/helpers/rest.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/rest/helpers/rest.php b/modules/rest/helpers/rest.php
index 423765bb..93ad2bd3 100644
--- a/modules/rest/helpers/rest.php
+++ b/modules/rest/helpers/rest.php
@@ -75,10 +75,14 @@ class rest_Core {
/**
* Return an absolute url used for REST resource location.
* @param string module name (eg, "gallery", "tags")
- * @param string relative path (eg "Family/Weddings.jpg")
- * @return string complete url
+ * @param object resource
*/
- static function url($module, $path) {
- return url::abs_site("rest/$module/$path");
+ static function url($module, $resource) {
+ $class = "{$module}_rest";
+ if (!method_exists($class, "url")) {
+ throw new Exception("@todo MISSING REST CLASS: $class");
+ }
+
+ return call_user_func(array($class, "url"), $resource);
}
}