summaryrefslogtreecommitdiff
path: root/modules/tag/models
diff options
context:
space:
mode:
Diffstat (limited to 'modules/tag/models')
-rw-r--r--modules/tag/models/tag.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/tag/models/tag.php b/modules/tag/models/tag.php
index d9488e1c..49512daa 100644
--- a/modules/tag/models/tag.php
+++ b/modules/tag/models/tag.php
@@ -102,4 +102,18 @@ class Tag_Model extends ORM {
}
return $result;
}
+
+ /**
+ * Return the server-relative url to this item, eg:
+ * /gallery3/index.php/tags/35
+ *
+ * @param string $query the query string (eg "page=3")
+ */
+ public function url($query=null) {
+ $url = url::site("tags/$this->id");
+ if ($query) {
+ $url .= "?$query";
+ }
+ return $url;
+ }
} \ No newline at end of file