mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 20:52:48 +08:00
更名为 traits\controller\jump 内置放入 \think\controller
继承 \think\Controller 后可以直接使用下面三个方法:
return $this->error('错误');
return $this->success('成功');
return $this->redirect('index/hello');
This commit is contained in:
@@ -12,9 +12,11 @@
|
||||
namespace think;
|
||||
|
||||
T('controller/view');
|
||||
T('controller/jump');
|
||||
|
||||
class Controller
|
||||
{
|
||||
use \traits\controller\jump;
|
||||
use \traits\controller\view;
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
/**
|
||||
* 用法:
|
||||
* T('controller/response');
|
||||
* T('controller/jump');
|
||||
* class index
|
||||
* {
|
||||
* use \traits\controller\response;
|
||||
* use \traits\controller\jump;
|
||||
* public function index(){
|
||||
* $this->error();
|
||||
* $this->redirect();
|
||||
@@ -14,7 +14,9 @@
|
||||
*/
|
||||
namespace traits\controller;
|
||||
|
||||
trait Response
|
||||
use think\Response;
|
||||
|
||||
trait Jump
|
||||
{
|
||||
// 视图类实例
|
||||
protected $view = null;
|
||||
Reference in New Issue
Block a user