summaryrefslogtreecommitdiff
path: root/modules/rest/helpers/rest.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-01-19 01:33:57 -0800
committerBharat Mediratta <bharat@menalto.com>2010-01-19 01:33:57 -0800
commitc590fed132b07647c38b1d5b4a93ffe30b6ac4bf (patch)
tree5033885b2775694a0971592549eb385225e49b4a /modules/rest/helpers/rest.php
parentf95442c314f84004c48758579f076ae209aace43 (diff)
Change rest::url() to take a module name and a resource. The module
does the rest. This function is symmetrical to rest::resolve.
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);
}
}