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

    
    
    {$Request.param.templateid}

 

2、ThinkPHP 5_第1张图片

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

 

你可能感兴趣的:(ThinkPHP 5)