From 846f365db9d3c1b61ed4bd68316bd5e7b80e56ec Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 14 Nov 2009 16:17:19 -0800 Subject: Normalize tags a bit. - Create Tag_Model::url() to mimic Item_Model::url() - Use the same pagination logic as we do for viewing items --- modules/tag/models/tag.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'modules/tag/models') 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 -- cgit v1.2.3