Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- resources.db.adapter = "Pdo_SQLite"
- resources.db.params.dbname = APPLICATION_PATH "/data/db/zftraining.db"
- resources.db.isDefaultTableAdapter = true
- // application/controllers/UsersController.php
- public function userListAction()
- {
- $users = new Application_Model_Users();
- $this->view->userList = $users->getDbUsers();
- }
- // application/model/Users.php
- public function getDbUsers()
- {
- $user = new Application_Model_DbTable_User();
- $userList = $user->fetchAll(null, 'name');
- foreach ($userList as $user) {
- $this->addUser(new Application_Model_User(
- $user->name, sprintf('http://twitter.com/%s', $user->twitter)));
- }
- return $this->getUsers();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement