Skip to content

Instantly share code, notes, and snippets.

@eminetto
Created November 4, 2012 13:52
Show Gist options
  • Save eminetto/4012002 to your computer and use it in GitHub Desktop.
Save eminetto/4012002 to your computer and use it in GitHub Desktop.
<?php
namespace Application\Controller;
use Zend\View\Model\ViewModel;
use Core\Controller\ActionController;
/**
* Controlador que gerencia os posts
*
* @category Application
* @package Controller
* @author Elton Minetto <[email protected]>
*/
class IndexController extends ActionController
{
/**
* Mostra os posts cadastrados
* @return void
*/
public function indexAction()
{
return new ViewModel(array(
'posts' => $this->getTable('Application\Model\Post')->fetchAll()->toArray()
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment