Created
July 5, 2011 21:38
-
-
Save robertbasic/1066023 to your computer and use it in GitHub Desktop.
Zend\View and the Variables
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 | |
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