如何使用 laravel4 从控制器访问模型?
到目前为止,我有我的控制器:
<?php
class GatewayController extends BaseController {
public function getContentAll()
{
$content = Content::getContentAll();
return $content;
}
我的模型:
<?php
class Content extends Eloquent {
protected $table = '_content';
public function getContentAll(){
return 'test';
}
但我得到:
Whoops, looks like something went wrong.