Created
November 4, 2012 14:12
-
-
Save eminetto/4012084 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* 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