ErrorException[Error]:类';Model_Search';找不到


ErrorException [ Error ]: Class 'Model_Search' not found

我从本地主机移到web主机来测试应用程序,一切都如预期的那样工作,但当我试图使用通过oil生成的模型时,它会抛出错误,说类不存在,但它确实存在。

我使用的代码:

use 'Model'Search;
class Controller_Search extends Controller_Template
{
    public function action_search()
    {
        if ($_POST['Search']) {
            $name['communities'] = Model_Search::query()->where('zip', '=', $_POST['Search'])->get();
            $name['count'] = count($name['communities']);
            $this->template->title = 'Search » Search';
            $name['canShow'] = true;
            $this->template->content = View::forge('search/search', $name);
        } else {
            $name['count'] = 0;
            $this->template->title = 'Search » Search';
            $name['canShow'] = false;
            $this->template->content = View::forge('search/search', $name);
        }
    }
}

问题是,是什么导致了这种情况?我该怎么修??

在定义和自动加载器中,''Model''Search与''Model_Search不同,尽管两者都指向同一个文件。

所以,下定决心如何使用你的模型,并保持一致。