![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
thinkphp
原克技术
这个作者很懒,什么都没留下…
展开
-
yii,nginx,伪静态,忽略入口文件
# nginx configurationlocation / { if (!-e $request_filename){ rewrite ^(.*)$ /index.php; }}原创 2021-01-25 11:18:25 · 147 阅读 · 0 评论 -
tp5,nginx,伪静态,忽略入口文件
location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; } }原创 2021-01-25 11:17:05 · 184 阅读 · 0 评论 -
thinkphp5封装查询条件
```csspublic function listApi() { $param = input('post.'); $page = $param['page'] ?? 1; $where['is_delete'] = 0; $where['admin'] = 0; if (!empty($param['username'])) { $where['username'] = $param[.原创 2020-09-29 00:59:22 · 345 阅读 · 0 评论 -
thinkphp验证器的使用
validate的使用方法一$validate= think\loader::validate("User");if(!$validate->scene("add")->check("$arr")){ return $arr=['error'=>$validate->getError(),'code'=>1]; //返回到静态页面会变成json数据}else{}使用方法二//$attr表示的是要检测的数据$validate原创 2020-09-29 00:56:55 · 199 阅读 · 0 评论 -
tp5验证器
<?phpnamespace app\admin\validate;use think\Validate;class User extends Validate{ protected $rule = [ 'id' => 'require|number', 'username' =>'require|chsDash', 'oldpassword' => 'require', 'password' =&g原创 2020-09-29 00:52:51 · 83 阅读 · 0 评论 -
th5修改返回数据的类型
1.添加一个配置,方便我们使用,配置的名字可以随意起(application/config.php)配置文件'root_namespace' => [], // 默认输出类型 'default_return_type' => 'json', // 是否返回json规范的格式 'api_return_standard' => true,2.处理数据的文件如果我们在配置文件中输出类型修改成json的时候,会执行的类是th原创 2020-09-27 16:12:36 · 382 阅读 · 0 评论 -
tp5中使用ajax
function getinfo(id){ $.get("{:url('news/info')}",{id:id},function(data){ $(".modal-body").html(data); }) } function statics(id){ $.post("{:url('news/statics')}",{id:id},function(data){ if(data.statics==1){ $(".statics"+id).html("<butt原创 2020-08-20 20:34:40 · 615 阅读 · 0 评论 -
tp5模板布局的使用
1.公共内容显示(定义在公共模板中){block name="mains"}{/block}2.继承公共模板在这里我们公共模板,放置在public文件夹下面,文件名是public.html{extend name="public/public"}{block name="mains"}{/block}原创 2020-08-20 16:12:53 · 400 阅读 · 0 评论 -
ajax数据上传,ajax获取全部要上传的数据
ajax代码块function add(){//获取全部内容 **$user=$("#addForm").serialize();** $.post("{:url('user_add')}",{user:$user},function(data){ if(data){ $('.table').append(data); }else{ alert('添加失败'); }原创 2020-08-11 00:35:37 · 115 阅读 · 0 评论 -
[“a“,“b“,“c“]格式的数据处理
以下数据类型的处理[“20200809\ba195779eeabec752cea11b746007dad.png”,“20200809\fe2921c21f31ed44b0723149bdf06cd3.png”,“20200809\06c0203f6b935347be0a377f70a6e161.png”]全部数据处理public function index(){ $k=input('post.name'); $data=Db::name('apply')->where('nam原创 2020-08-11 00:20:11 · 238 阅读 · 0 评论 -
tp5隐藏入口文件失败
在C:\LDE\phpStudy-2018\PHPTutorial\nginx\conf\vhosts.conf文件对应域名下添加if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; }server {listen 80;server_name www.syht-old-dd.com ;root “G:\Wsyht\syht-php\syht原创 2020-06-29 10:22:07 · 226 阅读 · 0 评论