summaryrefslogtreecommitdiff
path: root/modules/tag/models
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2013-01-13 13:21:48 -0800
committerBharat Mediratta <bharat@menalto.com>2013-01-13 13:21:48 -0800
commit2d010c07d3a0c1491f4e2fe0ee370f0d0116fdef (patch)
tree30865f2ded9311d95fec6d6e73e3765b2f084134 /modules/tag/models
parent3a3c21dfc42b94a5340634d9c0b19acf83b1fedb (diff)
parentf92982c59c0db3d86a6a05231c720a39bbbb3d2d (diff)
Merge pull request #86 from mikeage/tag_name
Tags by name (includes a G2 mapping) Fixes #1940.
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;
+ }
+}