zendframework “Fatal error: Class 'Albums' not found in”,急急急

yuxingye 2011-02-24 09:27:06
Index Controllers:

public function indexAction ()
{
$this->view->title = "My Albums";
$this->view->headTitle($this->view->title, 'PREPEND');
$albums = new Albums();
$this->view->albums = $albums->fetchAll();
}

models:
class Albums extends Zend_Db_Table_Abstract
{

protected $_name = 'albums';

public function getAlbum ($id)
{
$id = (int) $id;
$row = $this->fetchRow('id = ' . $id);
if (! $row) {
throw new Exception("Count not find row $id");
}
return $row->toArray();
}
}

走到$albums = new Albums();出错,
Fatal error: Class 'Albums' not found in F:\workplat\xampp\htdocs\app\application\controllers\IndexController.php on line 12

请各位仁兄帮帮忙,郁闷死我了!
...全文
108 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
life169 2011-02-24
  • 打赏
  • 举报
回复
class Albums extends Zend_Db_Table_Abstract

改成

class Albums
yuxingye 2011-02-24
  • 打赏
  • 举报
回复
谢谢,我在看看
wdar1314 2011-02-24
  • 打赏
  • 举报
回复
$albums = new Albums();
那就说明这个类在实例化之前并没有加载成功,或者是你IndexController.php 的问题。

4,251

社区成员

发帖
与我相关
我的任务
社区描述
国内外优秀PHP框架讨论学习
社区管理员
  • Framework
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧