Advertisement
mOrloff

Untitled

Jun 29th, 2011
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. <?php // \controllers\UserController.php
  2. ...
  3.     private function viewAction($var = null) {
  4.         $var = $var? $var: 'user';
  5.         $this->render($var);
  6.     }
  7.  
  8.     public function usersAction() {
  9.         $list = array('Bob', 'Steve', 'Mike', 'Sally', 'Frank');
  10.         $this->view->userlist = $list; //array('Bob', 'Steve', 'Mike', 'Sally', 'Frank');
  11.         $this->viewAction();
  12.     }
  13. ... ?>
  14.  
  15. // \views\scripts\user\user.phtml
  16. ...
  17. <h1>User List</h1>
  18.     <?php
  19.         /*$list = array('Bob', 'Steve', 'Mike', 'Sally', 'Frank');
  20.         echo $this->htmlList($list);*/  // this works
  21.         var_dump($this->userlist);  // this does NOT work
  22.         //echo $this->htmlList($this->userlist);  
  23.     ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement