mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-09 16:12:49 +08:00
traits层次调整去掉 think目录 用户自定义的traits可以放到模块目录下面区分
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 用法:
|
||||
* T('think/controller/ajax');
|
||||
* T('controller/ajax');
|
||||
* class index
|
||||
* {
|
||||
* use \traits\think\controller\ajax;
|
||||
* use \traits\controller\ajax;
|
||||
* public function index(){
|
||||
* $this->result();
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
namespace traits\think\controller;
|
||||
use think\Config;
|
||||
namespace traits\controller;
|
||||
|
||||
trait Ajax
|
||||
{
|
||||
@@ -1,17 +1,19 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 用法:
|
||||
* T('think/controller/view');
|
||||
* T('controller/view');
|
||||
* class index
|
||||
* {
|
||||
* use \traits\think\controller\view;
|
||||
* use \traits\controller\view;
|
||||
* public function index(){
|
||||
* $this->assign();
|
||||
* $this->show();
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
namespace traits\think\controller;
|
||||
namespace traits\controller;
|
||||
|
||||
use think\Config;
|
||||
|
||||
trait View
|
||||
@@ -9,7 +9,7 @@
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace traits\think\model;
|
||||
namespace traits\model;
|
||||
|
||||
use think\Lang;
|
||||
use think\Loader;
|
||||
@@ -9,7 +9,7 @@
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace traits\think\model;
|
||||
namespace traits\model;
|
||||
|
||||
define('EXISTS_VALIDATE', 0);
|
||||
define('MUST_VALIDATE', 1);
|
||||
@@ -62,8 +62,8 @@ trait Auto
|
||||
$fields = explode(',', $fields);
|
||||
}
|
||||
// 判断令牌验证字段
|
||||
if (C('TOKEN_ON')) {
|
||||
$fields[] = C('TOKEN_NAME');
|
||||
if (Config::get('token_on')) {
|
||||
$fields[] = Config::get('token_name');
|
||||
}
|
||||
|
||||
foreach ($data as $key => $val) {
|
||||
@@ -9,7 +9,7 @@
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace traits\think\model;
|
||||
namespace traits\model;
|
||||
|
||||
trait Query
|
||||
{
|
||||
@@ -9,7 +9,7 @@
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace traits\think\model;
|
||||
namespace traits\model;
|
||||
|
||||
define('HAS_ONE', 1);
|
||||
define('BELONGS_TO', 2);
|
||||
@@ -9,7 +9,7 @@
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace traits\think\model;
|
||||
namespace traits\model;
|
||||
|
||||
trait View
|
||||
{
|
||||
Reference in New Issue
Block a user