Skip to content

Commit

Permalink
new helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan Nilsson committed Nov 2, 2008
1 parent c16f11b commit 1fa4694
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions application/views/helpers/PhotoLink.php
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');
}

}

0 comments on commit 1fa4694

Please sign in to comment.