diff options
Diffstat (limited to 'modules/tag/models')
-rw-r--r-- | modules/tag/models/tag.php | 18 |
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; + } +} |