<?php
// http://localhost/tp3/index.php/Home/Index/index 是这个路径
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
public function index(){
$this->show('<p>欢迎使用 <b>index页面</b>!</p>');
}
public function add(){
$Tables= M("tables"); //M方法自动造模型
$at =$Tables->where('ages=20')->select();
$this->show(json_encode($at,JSON_UNESCAPED_UNICODE));
//json_encode是转换成json字符串 第二个参数是解决中文乱码问题
}
}