1
0

Add tag->abs_url() to tag_albums

This commit is contained in:
Mike Miller 2013-01-14 05:47:31 +02:00
parent 48a1269547
commit 57025d18dc

View File

@ -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/tag_albums/tags/35/0/Bob
*
* @param string $query the query string (eg "page=3")
*/
@ -157,4 +157,22 @@ class Tag_Model_Core extends ORM {
}
return $url;
}
}
/**
* Return the full url to this item, eg:
* http://example.com/gallery3/index.php/tag_albums/tag/35/0/Bob
*
* @param string $query the query string (eg "page=3")
*/
public function abs_url($query=null) {
$album_id = Input::instance()->get("album");
if (!($album_id)) {
$album_id = 0;
}
$url = url::abs_site("/tag_albums/tag/{$this->id}/{$album_id}/" . urlencode($this->name));
if ($query) {
$url .= "?$query";
}
return $url;
}
}