Skip to content

Instantly share code, notes, and snippets.

@eminetto
Created June 8, 2014 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eminetto/86e810dac94a3f761d73 to your computer and use it in GitHub Desktop.
Save eminetto/86e810dac94a3f761d73 to your computer and use it in GitHub Desktop.
<?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