liliuwei/thinkphp-jump 是 TP5 中经典跳转提示,在 TP6 中已经取消,通过 composer 下载该扩展可以在 TP6 中使用 TP5 的跳转提示操作。

安装扩展
在应用根目录执行:
            
            
              html
              
              
            
          
          composer require liliuwei/thinkphp-jump引入扩展
在全局配置目录生成 jump.php 文件:
            
            
              html
              
              
            
          
          return[
    // 默认跳转页面对应的模板文件
    'dispatch_success_tmpl' => app()->getRootPath().'/vendor/liliuwei/thinkphp-jump/src/tpl/dispatch_jump.tpl',
    'dispatch_error_tmpl'   => app()->getRootPath().'/vendor/liliuwei/thinkphp-jump/src/tpl/dispatch_jump.tpl',
];使用扩展
            
            
              html
              
              
            
          
          <?php
namespace app\controller;
class Index 
{
    // 在控制器中引入 Jump
    use \liliuwei\think\Jump; 
    public function index(){
        return  $this->success('成功','跳转地址');
        return  $this->error('失败','跳转地址');
    }
}