Am trying to connect to Database table using Zend_Db_Table_Abstract. To do this am following these steps
Step1: Created a class which extends Zend_Db_Table_Abstract
<?php
class Application_Model_DbTable_Albums extends Zend_Db_Table_Abstract{
protected $_name = "zfalbums";
public function getAlbums($id){
$where = "id = $id";
$row = $this->fetchRow($where);
$row->toArray();
return $row;
}
}
Step2: Calling above class in controller, like this
<?php
class IndexController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
;
$albums = new Application_Model_DbTable_Albums();
$result = $albums->fetchAll()->toArray();
print_r($result);
}
}
Step3: Accessing index controller by using local host url
However when try to run this controller following error is thrown
Fatal error: Class 'Application_Model_DbTable_Albums' not found in
Here is the my project structure
