Created
June 8, 2014 14:37
-
-
Save eminetto/86e810dac94a3f761d73 to your computer and use it in GitHub Desktop.
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
<?php | |
namespace Application\Controller; | |
use Zend\View\Model\ViewModel; | |
use Zend\Mvc\Controller\AbstractActionController; | |
/** | |
* Controlador que gerencia os posts | |
* | |
* @category Application | |
* @package Controller | |
* @author Elton Minetto <eminetto@coderockr.com> | |
*/ | |
class PostController extends AbstractActionController | |
{ | |
/** | |
* Mostra os posts cadastrados | |
* @return void | |
*/ | |
public function indexAction() | |
{ | |
$tableGateway = $this->getServiceLocator()->get('Application\Model\PostTableGateway'); | |
$posts = $tableGateway->fetchAll(); | |
return new ViewModel(array( | |
'posts' => $posts | |
)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment