Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.