【发布时间】:2014-03-05 16:23:56
【问题描述】:
我有这个模型文件:
\app\models\Recipe.php
<? php
class Recipe extends Eloquent{
protected $table = 'recipes';
}
这是我的控制器:
<?php
class IndexController extends BaseController {
public function showIndex()
{
$recipes = Recipe::all();
return View::make('index',array('recipes' => $recipes));
}
}
当我尝试调用该页面时,我收到此错误消息:
Symfony \ Component \ Debug \ Exception \ FatalErrorException
Class 'Recipe' not found
我也执行了
composer dump-autoload
知道有什么问题吗?
【问题讨论】:
-
你的源代码真的是
<? php而不是<?php吗?
标签: php model frameworks laravel