mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22: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;
|
namespace think;
|
||||||
|
|
||||||
T('controller/view');
|
T('controller/view');
|
||||||
|
T('controller/jump');
|
||||||
|
|
||||||
class Controller
|
class Controller
|
||||||
{
|
{
|
||||||
|
use \traits\controller\jump;
|
||||||
use \traits\controller\view;
|
use \traits\controller\view;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 用法:
|
* 用法:
|
||||||
* T('controller/response');
|
* T('controller/jump');
|
||||||
* class index
|
* class index
|
||||||
* {
|
* {
|
||||||
* use \traits\controller\response;
|
* use \traits\controller\jump;
|
||||||
* public function index(){
|
* public function index(){
|
||||||
* $this->error();
|
* $this->error();
|
||||||
* $this->redirect();
|
* $this->redirect();
|
||||||
@@ -14,7 +14,9 @@
|
|||||||
*/
|
*/
|
||||||
namespace traits\controller;
|
namespace traits\controller;
|
||||||
|
|
||||||
trait Response
|
use think\Response;
|
||||||
|
|
||||||
|
trait Jump
|
||||||
{
|
{
|
||||||
// 视图类实例
|
// 视图类实例
|
||||||
protected $view = null;
|
protected $view = null;
|
||||||
Reference in New Issue
Block a user