mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-05 22:52:49 +08:00
调整类的文件命名规范为psr-4
This commit is contained in:
61
library/traits/controller/Jump.php
Normal file
61
library/traits/controller/Jump.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 用法:
|
||||
* T('controller/jump');
|
||||
* class index
|
||||
* {
|
||||
* use \traits\controller\jump;
|
||||
* public function index(){
|
||||
* $this->error();
|
||||
* $this->redirect();
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
namespace traits\controller;
|
||||
|
||||
use think\Response;
|
||||
|
||||
trait Jump
|
||||
{
|
||||
/**
|
||||
* 操作错误跳转的快捷方法
|
||||
* @access public
|
||||
* @param mixed $msg 提示信息
|
||||
* @param mixed $data 返回的数据
|
||||
* @param mixed $url 跳转的URL地址
|
||||
* @param mixed $wait 跳转等待时间
|
||||
* @return void
|
||||
*/
|
||||
public function error($msg = '', $data = '', $url = '', $wait = 3)
|
||||
{
|
||||
return Response::error($msg, $data, $url, $wait);
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作成功跳转的快捷方法
|
||||
* @access public
|
||||
* @param mixed $msg 提示信息
|
||||
* @param mixed $data 返回的数据
|
||||
* @param mixed $url 跳转的URL地址
|
||||
* @param mixed $wait 跳转等待时间
|
||||
* @return void
|
||||
*/
|
||||
public function success($msg = '', $data = '', $url = '', $wait = 3)
|
||||
{
|
||||
return Response::success($msg, $data, $url, $wait);
|
||||
}
|
||||
|
||||
/**
|
||||
* URL重定向
|
||||
* @access protected
|
||||
* @param string $url 跳转的URL表达式
|
||||
* @param array|int $params 其它URL参数或http code
|
||||
* @return void
|
||||
*/
|
||||
public function redirect($url, $params = [])
|
||||
{
|
||||
return Response::redirect($url, $params);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user