ThinkPHP 5

 

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、

控制器 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);

 

posted @ 2019-06-27 17:51  微客鸟窝  阅读(166)  评论(0编辑  收藏  举报
/* 看板娘 */