Skip to content

Instantly share code, notes, and snippets.

@eminetto
Created November 4, 2012 14:12
Show Gist options
  • Save eminetto/4012084 to your computer and use it in GitHub Desktop.
Save eminetto/4012084 to your computer and use it in GitHub Desktop.
/**
* Retorna os comentários de um post
* @return Zend\Http\Response
*/
public function commentsAction()
{
$id = (int) $this->params()->fromRoute('id', 0);
$where = array('post_id' => $id);
$comments = $this->getTable('Application\Model\Comment')
->fetchAll(null, $where)
->toArray();
$result = new ViewModel(array(
'comments' => $comments
)
);
$result->setTerminal(true);
return $result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment