ThinkPHP 5

use thinkController

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);

原文地址:https://www.cnblogs.com/isungge/p/10961394.html