Skip to content

Instantly share code, notes, and snippets.

@robzienert
Created May 11, 2011 21:27
Show Gist options
  • Select an option

  • Save robzienert/967399 to your computer and use it in GitHub Desktop.

Select an option

Save robzienert/967399 to your computer and use it in GitHub Desktop.
<?php
class FooController extends Zend_Controller_Action
{
public function listAction()
{
$usersAndStuff = $model->getUsersAndStuff();
$this->view->users = $this->getUsersAndStuff();
}
public function addAction()
{
$form = new LolForm();
$request = $this->getRequest();
if ($request->isPost()) {
if ($form->isValid($request->getPost())) {
// do save stuff.
}
}
$this->view->assign(array(
'form' => $form,
'users' => $this->getUsersAndStuff(),
));
$this->render('list.phtml');
}
protected function getUsersAndStuff()
{
return $model->findUsersAndStuff();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment