ThinkPHP 6 添加跳转提示扩展 liliuwei/thinkphp-jump

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('失败','跳转地址');
    }
}
相关推荐
恋猫de小郭37 分钟前
iOS 26 正式版即将发布,Flutter 完成全新 devicectl + lldb 的 Debug JIT 运行支持
android·前端·flutter
幻雨様1 小时前
UE5多人MOBA+GAS 54、用户登录和会话创建请求
android·ue5
Just_Paranoid1 小时前
【SystemUI】锁屏来通知默认亮屏Wake模式
android·framework·systemui·keyguard·aod
没有了遇见1 小时前
Android +,++,+= 的区别
android·kotlin
_无_妄_3 小时前
Android 使用 WebView 直接加载 PDF 文件,通过 JS 实现
android
VomPom3 小时前
手写一个精简版Koin:深入理解依赖注入核心原理
android
IT乐手3 小时前
Java 编写查看调用栈信息
android
Digitally4 小时前
如何轻松永久删除 Android 手机上的短信
android·智能手机
JulyYu5 小时前
Flutter混合栈适配安卓ActivityResult
android·flutter
Warren985 小时前
Appium学习笔记
android·windows·spring boot·笔记·后端·学习·appium