我从我的本地主机移动到我的网络主机以测试应用程序,一切都按预期工作,但是当我尝试使用通过 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);
}
}
}
问题是,这是什么原因造成的?我该如何解决?