首页 > Web开发 > 详细

php框架

时间:2018-10-23 19:17:17      阅读:115      评论:0      收藏:0      [点我收藏+]

用的tp3.2,

入口文件:项目名称,入口文件,模块,控制器,方法 localhost/tp3.2/index.php/admin/Car/index;
配置文件:config.php
命名:给类文件命名需要注意Controller C要大写,class.php是死的
动态获取用C(‘DATA_CACH_TIME‘,60);
目录结构:核心,Thinkphp
公共资源,public
公共目录,application
命名空间:namespace;

U(url)是地址,M(model)链接数据库,I()表单提交  (‘URL_HTML_SUFFIX‘,‘.ww‘); 加后缀 伪的。

跳转:

 $url = U(‘Admin/Car/index/id/6‘);
 $this->success(‘我喜欢你‘,$url);

$str = "this is some<b>bold</b> text";    //在html里带标签使用了

echo htmlspecialchars($str);        //原样输出不带样式

asc是正序,dsc是倒序  group(2个值,第一个第几组,第二个是放几个)分组   limit(两个值,第一个从第几个开始,第二个到第几个结束)  分组

一对多要创建2个表,

$info = M(‘studys‘);   //连接表名

 $arr = $info->field(‘studys.id,name,class_name‘)->join("class on class.study_id=studys.id")     //field 过滤
 ->select();  

多对多要创建3个表,

$info = M(‘class_study‘);    //连接三个表的,连接其他的那个表
$arr = $info->join(‘ymt_class on class_study . class_id = ymt_class . id‘)      //.是谁下的谁,_是名字连接的
->join(‘studys on class_study . study_id = studys . id ‘)
->where([‘ymt_class.class_name‘ => 1803])                 //查找
->select();

 

php框架

原文:https://www.cnblogs.com/meimou/p/9838403.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!