Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // application/Bootstrap.php
- protected function _initDatabases()
- {
- $db = Zend_Db::factory('PDO_MySQL', array (
- 'hostname' => 'localhost',
- 'username' => 'zfessentials',
- 'password' => 'getsmart',
- 'dbname' => 'zfessentials',
- ));
- }
- // application/controllers/DatabaseController.php
- public function indexAction()
- {
- $bootstrap = $this->getInvokeArg('bootstrap');
- $db = $bootstrap->getResource('db');
- $this->view->users = $db->fetchAll(
- $db->select()
- ->from('users'));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement