$cate = new \app\common\model\Gallery();
$result=$cate->edit($data);
if($result==1)
{
$this->success('密码修改成功','index/Gallery/infor');
}
else
{
$this->error($result);
}
在做修改密码功能时,我确定可以进入到上方if条件中,密码可以被修改,就是页面不弹出修改成功且跳转网页。
解决方法:
//向模型传数据
$cate = new \app\common\model\Gallery();
$result=$cate->edit($data);
if($result==1)
{
ob_end_clean();
$this->success('栏目修改成功','index/Gallery/infor');
}
else
{
ob_end_clean();
$this->error($result);
}
就是在$this->success和$this->error前写上ob_end_clean();
好久没学习这个框架了,之前也犯过一次这样的错,记录一下。