Model:relation您所请求的方法不存在!什么情况

浏览:4092 发布日期:2013/11/05 分类:求助交流
Public function index(){
$news=D('news')->relation(true)->select();
//p($news);
//die;
$this->display();

}
模型:<?php
Class NewsRelationModel extends RelationModel{
Protected $tableName='news';
Protected $_link=array(
'new_attr'=>array(
'mapping_type'=>BLONGS_TO,

'foreign_key'=>'cid',

'mapping_fields'=>'name'
)
);
}

?>
主表名:news,另一个表名:new_attr,

出现错误:
Model:relation您所请求的方法不存在!
错误位置

FILE: D:\apache\htdocs\php5\nowstore\ThinkPHP\Lib\Core\Model.class.php  LINE: 253
最佳答案
评论() 相关
后面还有条评论,点击查看>>