From 2c0b0aaebca6ec1149585853d7d849d50bea4184 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 19 Jan 2010 00:35:32 -0800 Subject: Add rest::url() for convenience. --- modules/rest/helpers/rest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'modules/rest/helpers') diff --git a/modules/rest/helpers/rest.php b/modules/rest/helpers/rest.php index 121191f2..423765bb 100644 --- a/modules/rest/helpers/rest.php +++ b/modules/rest/helpers/rest.php @@ -71,4 +71,14 @@ class rest_Core { return call_user_func(array($class, "resolve"), !empty($components[2]) ? $components[2] : null); } + + /** + * 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 + */ + static function url($module, $path) { + return url::abs_site("rest/$module/$path"); + } } -- cgit v1.2.3