求助

浏览:279 发布日期:2019/04/03 分类:ThinkPHP5专区
<?php
namespace app\luntan\controller;
use think\View;
use think\Controller;
use think\Db;
use app\luntan\model\Essay as EssayModel;
use app\luntan\controller\Index;
class Read extends Controller{
public function read(){
$index=new Index();
$index->index();
$result=$this->read_essay();
dump($result);
$this->assign('title','阅读文章');
$this->assign('result',$result);
return $this->fetch();
}
public function read_essay(){
if(request()->isGet()){
$essaytitle=$_GET['title'];
$essay=new EssayModel();
$result=$essay->read_essay($essaytitle);
if($result){
return $result;
}else{
$this->error('未知错误');
}
}else{
$this-error('未知错误');
}
}
}
数据能够dump出来,但是使用assgin一直显示result未定义
最佳答案
评论() 相关
后面还有条评论,点击查看>>