-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Johan Nilsson
committed
Nov 2, 2008
1 parent
c16f11b
commit 1fa4694
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
class Zend_View_Helper_PhotoLink | ||
{ | ||
/** | ||
* Sets the view instance. | ||
* | ||
* @param Zend_View_Interface $view View instance | ||
* @return Zend_View_Helper_PaginationControl | ||
*/ | ||
public function setView(Zend_View_Interface $view) | ||
{ | ||
$this->view = $view; | ||
return $this; | ||
} | ||
|
||
/** | ||
* Return the url to a photo | ||
* | ||
* @param Zend_Db_Table_Row $photo | ||
* @return string | ||
*/ | ||
public function photoLink($photo) | ||
{ | ||
return $this->view->url(array( | ||
'id' => $photo->id, | ||
'year' => date('Y', strtotime($photo->created_on)), | ||
'month' => date('m', strtotime($photo->created_on)), | ||
'day' => date('d', strtotime($photo->created_on)) | ||
), 'photo'); | ||
} | ||
|
||
} |