Model:Relation您所请求的方法不存在!换别的方法就成功

浏览:3405 发布日期:2014/03/21 分类:求助交流 关键字: Relation Model 方法
IndexAction.class.phpclass IndexAction extends Action {
    public function index(){
        //$Data=new IndexModel('Show');
        $Data = D("Show");   
        $list = $Data->relation(true)->select();
        print_r($list);
    }
}
IndexModel.class.phpclass IndexModel extends RelationModel{
    protected $_link=array(
        'Show'=>array(
            'mapping_type'    =>BELONGS_TO,
            'class_name'    =>'Menu',
        ),
    );   
}
会出现Model:Relation您所请求的方法不存在!
错误位置
FILE: D:\WWW\menglechong\Lib\Core\Model.class.php  LINE: 253
这个错误

如果把 $Data = D("Show");换成$Data=new IndexModel('Show');就没问题求解决办法
最佳答案
评论( 相关
后面还有条评论,点击查看>>