0
点赞
收藏
分享

微信扫一扫

ThinkPHP 5

独西楼Q 2022-03-25 阅读 137



use think\Controller

1、$this->request->param();      内置request 安全对象, 不再使用 $_GET ,$_POST

2、pathinfo  下 前台获取url参数   ​​http://120.77.62.87/Questionnaire/public/index.php/home/Index/login/templateid/21​​

<?php echo input('templateid');?>


{$Request.param.templateid}


2、

ThinkPHP 5_url参数

控制器 hello_world  表示为 HelloWorld  , config.php 中 url_convert 选项可以关闭/开启 转换

3、用Db类操作数据库

  Db::table('tb_biao')->where($map)->order('sort_number asc')->select();

  Db::table('tb_biao')->where($con_map)->value('value');

  Db::table('tb_biao')->where($where)->find();


  $phone['phone'] = $_REQUEST['phone'];

  Db::table('tb_biao')->where('phone="' . $phone['phone'] . '"')->update($phone);

  Db::table('tb_biao')->insert($phone);




举报

相关推荐

0 条评论