常用跳转:
if($result){
$this->success('操作成功!');
}else{
$this->error('写入错误!');
}*/
redirect跳转 :
$this->redirect("User/viewuser"); // Tpl下的 页面文件,即视图一级目录User/页面文件。 可简写 $this->redirect("viewuser");
给提示并跳转:
$this->success('操作成功', 'replylist'); //本视图层下的replylist. 。 第二个参数为 Tpl下的页面文件 。 同上
带数据跳转
//显示个人客户详情
public function view_customer(){
$customer = M('customer');
if($_GET){
$data = $customer->find($_GET['id']);
$this->assign('data',$data); //将查询结果给$data变量
if($_GET['customer_style']=='0'){
$this->display("view_customerp");//显示本视图层下的view_customerp
}else{
$this->redirect("view_customercom");
}
}else{
echo "传入参数错误!";
}
}