summaryrefslogtreecommitdiff
path: root/modules/tag/models
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-11-14 16:17:19 -0800
committerBharat Mediratta <bharat@menalto.com>2009-11-14 16:17:19 -0800
commit846f365db9d3c1b61ed4bd68316bd5e7b80e56ec (patch)
tree8dde35e3e121c0e48f1dd67432b01e44e7b2bdcc /modules/tag/models
parent9fd6a6f9058a89e60f83c6f2e89ae9e994c9e53a (diff)
Normalize tags a bit.
- Create Tag_Model::url() to mimic Item_Model::url() - Use the same pagination logic as we do for viewing items
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