summaryrefslogtreecommitdiff
path: root/modules/tag/models
diff options
context:
space:
mode:
authorMike Miller <github@mikeage.net>2013-01-09 06:42:32 +0200
committerMike Miller <github@mikeage.net>2013-01-13 05:36:50 +0200
commitf92982c59c0db3d86a6a05231c720a39bbbb3d2d (patch)
tree30865f2ded9311d95fec6d6e73e3765b2f084134 /modules/tag/models
parent3a3c21dfc42b94a5340634d9c0b19acf83b1fedb (diff)
Tags by name (includes a G2 mapping)
Diffstat (limited to 'modules/tag/models')
-rw-r--r--modules/tag/models/tag.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/modules/tag/models/tag.php b/modules/tag/models/tag.php
index 298e4647..213ea0df 100644
--- a/modules/tag/models/tag.php
+++ b/modules/tag/models/tag.php
@@ -141,7 +141,7 @@ class Tag_Model_Core extends ORM {
/**
* Return the server-relative url to this item, eg:
- * /gallery3/index.php/tags/35
+ * /gallery3/index.php/tags/35/Bob
*
* @param string $query the query string (eg "page=3")
*/
@@ -152,4 +152,18 @@ class Tag_Model_Core extends ORM {
}
return $url;
}
-} \ No newline at end of file
+
+ /**
+ * Return the full url to this item, eg:
+ * http://example.com/gallery3/index.php/tags/35/Bob
+ *
+ * @param string $query the query string (eg "page=3")
+ */
+ public function abs_url($query=null) {
+ $url = url::abs_site("tag/{$this->id}/" . urlencode($this->name));
+ if ($query) {
+ $url .= "?$query";
+ }
+ return $url;
+ }
+}