Skip to content

Instantly share code, notes, and snippets.

@robertbasic
Created July 5, 2011 21:38
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 robertbasic/1066023 to your computer and use it in GitHub Desktop.
Save robertbasic/1066023 to your computer and use it in GitHub Desktop.
Zend\View and the Variables
<?php
use Zend\Controller\Action,
Zend\View\Variables;
use App\Model;
class IndexController extends Action
{
public function init()
{
$this->model = new Model\News();
$this->viewVars = new Variables();
$this->view->setVars($this->viewVars);
}
public function indexAction()
{
$this->viewVars->offsetSet('news', $this->model->getAllActiveNews());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment