您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

thinkphp6不能用redirect重定向是什么情况?

2024/6/27 16:51:56发布31次查看
下面thinkphp框架教程栏目将给大家讲介绍关于thinkphp6不能用redirect重定向的问题,希望对需要的朋友有所帮助!
tp6在__construct和_initialize中无法使用redirect重定向?
说明
目前版本 return redirect('index/index'); 在__construct和_initialize无法使用,可以安装之前的代码方便使用
安装
composer require liliuwei/thinkphp-jump
用法示例
<?phpnamespace app\controller;class index { use \liliuwei\think\jump; public function index() { //return $this->error('error'); //return $this->success('success','index/index'); //return $this->redirect('/admin/index/index'); return $this->result(['username' => 'liliuwei', 'sex' => '男']); }}
推荐:《最新的10个thinkphp视频教程》
以上就是thinkphp6不能用redirect重定向是什么情况?的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product