tp3.2基础

地址/项目名/入口文件/模块/控制器/方法
类名.class.php

命名空间 namespace Homecontroller(目录);
use ThinkController;(引入Controller类*必须*) 
use ThinkDb;

class IndexController extends Controller(继承类)
{
IS_POST IS_GET IS_AJAX 判断接收方式

I('get.')//input 可以理解为表单 获取变量
C('name',123);//config 读取 设置配置文件
U();查找地址
$obj = M('students');可以理解为选择表
D();实例化表名,强定性

M('students')->find();

$obj->select(); //所有的
$obj->filed('id,name')->where()->find();//只查找第一条

$obj->create(I('post.'));//创建数据对象
$obj->where('id= xxx')->save(I('post.'));

$obj->add(I('post.'));

$obj->where()->delete();
$this->success();
$this->error();
$this->redirect();
$this->assign('arr',$list);//映射数据的
$this->dispaly();//映射页面
}

{$arr}
volist id="" name=""

<volist id="" name=""></volist>

<if condition="id eq 1">

</if>

原文地址:https://www.cnblogs.com/sw-3/p/9869024.html