diff --git a/application/controllers/IndexController.php b/application/controllers/IndexController.php index fddf83f..276ddba 100644 --- a/application/controllers/IndexController.php +++ b/application/controllers/IndexController.php @@ -11,6 +11,24 @@ public function init() public function indexAction() { // action body + $dbconf = new Zend_Config_Ini(APPLICATION_PATH.'/configs/application.ini','development'); + $db = Zend_Db::factory($dbconf->database); + + Zend_Db_Table_Abstract::setDefaultAdapter($db); + Zend_Registry::set('db',$db); + + require_once APPLICATION_PATH . '/models/User.php'; + + $user = new Users(); // Users Table Object. + $rowset = $user->fetchAll()->toArray(); + $list_of_users = array(); + + foreach($rowset as $row) { + $list_of_users[] = $row->id; + } + //$this->view->userlist + $this->view->id = 2; + } public function ajaxAction() diff --git a/application/models/User.php b/application/models/User.php new file mode 100644 index 0000000..e9c1877 --- /dev/null +++ b/application/models/User.php @@ -0,0 +1,16 @@ +