Advertisement
dragonbe

Untitled

Mar 10th, 2011
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1. resources.db.adapter = "Pdo_SQLite"
  2. resources.db.params.dbname = APPLICATION_PATH "/data/db/zftraining.db"
  3. resources.db.isDefaultTableAdapter = true
  4.  
  5.  
  6.     // application/controllers/UsersController.php
  7.     public function userListAction()
  8.     {
  9.         $users = new Application_Model_Users();
  10.         $this->view->userList = $users->getDbUsers();
  11.     }
  12.  
  13.  
  14.     // application/model/Users.php
  15.     public function getDbUsers()
  16.     {
  17.         $user = new Application_Model_DbTable_User();
  18.         $userList = $user->fetchAll(null, 'name');
  19.         foreach ($userList as $user) {
  20.             $this->addUser(new Application_Model_User(
  21.                 $user->name, sprintf('http://twitter.com/%s', $user->twitter)));
  22.         }
  23.         return $this->getUsers();
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement