随笔分类 - tp6
摘要:<?php // + // | ThinkPHP [ WE CAN DO IT JUST THINK ] // + // | Copyright (c) 2006-2019 http://thinkphp.cn All rights reserved. // + // | Licensed ( ht
阅读全文
摘要:public function redirect(...$argc){ throw new HttpResponseException(redirect(...$argc)); }
阅读全文
摘要:使用tp6验证码需要先引入 composer require topthink/think-captcha 自定义验证码 在项目模块下新建控制器 <?php namespace app\admin\controller; use think\captcha\facade\Captcha; class
阅读全文
摘要:复制provider.php到模块下 <?php use app\ExceptionHandle; use app\Request; // 容器Provider定义文件 return [ 'think\exception\Handle' =>'app\\demo\\exception\\Http',
阅读全文
摘要:controller 只负责参数的获取和判断,然后调用业务逻辑层,业务逻辑层负责调取model模型层的数据,然后组装数据,返回给controller控制器层,必要时由业务逻辑层调用lib基础库层
阅读全文
摘要:<?php namespace app\model; use think\Model; class User1 extends Model { public function getStatusTextAttr($value,$data){ $status = [ '1'=>'正常', '2'=>'
阅读全文
摘要:<?php // 应用公共文件 /** * 通用化api格式输出 * @param $status 业务状态码 * @param string $message 消息提示 * @param array $data 返回内容 * @param int $httpCode http状态码 * @retu
阅读全文
摘要:1 继承BaseController 2 引入app\Request 使用依赖注入的方式 $request->param() 3 助手函数 Input() 4 使用 request()->param() 方法 5 使用think\facade\Request 静态方法 <?php namespace
阅读全文
摘要:他大爷的,原来是在\config文件夹下的middleware.php里设置
阅读全文
摘要:composer require topthink/think-view 使用配置文件替换原本路径 config/view.php 'tpl_replace_string'=>[ '__STATIC__'=>'/static/' ]
阅读全文
摘要:比如app目录下的demo应用下controller文件夹下的Test控制器的test2方法 给它设定一个路由 访问方法就是 domian/应用/hello(路由规则) <?phpuse think\facade\Route;Route::rule('test','index/demo','GET'
阅读全文
摘要:使用多模块:composer require topthink/think-multi-app多模块下使用字段缓存 php think optimize:schema your_app
阅读全文

浙公网安备 33010602011771号