Created
November 4, 2012 13:55
-
-
Save eminetto/4012025 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
/** | |
* Mostra os posts cadastrados | |
* @return void | |
*/ | |
public function indexAction() | |
{ | |
$post = $this->getTable('Application\Model\Post'); | |
$sql = $post->getSql(); | |
$select = $sql->select(); | |
$paginatorAdapter = new PaginatorDbSelectAdapter($select, $sql); | |
$paginator = new Paginator($paginatorAdapter); | |
$paginator->setCurrentPageNumber($this->params()->fromRoute('page')); | |
return new ViewModel(array( | |
'posts' => $paginator | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment