class 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');就没问题求解决办法
最佳答案