<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>编程站点 - thinkphp框架</title>
    <link>https://bbs.tcp8.cn/forum.php?mod=forumdisplay&amp;fid=92</link>
    <description>Latest 20 threads of thinkphp框架</description>
    <copyright>Copyright(C) 编程站点</copyright>
    <generator>Discuz! Board by Comsenz Inc.</generator>
    <lastBuildDate>Sun, 12 Apr 2026 00:06:26 +0000</lastBuildDate>
    <ttl>60</ttl>
    <image>
      <url>https://bbs.tcp8.cn/static/image/common/logo_88_31.gif</url>
      <title>编程站点</title>
      <link>https://bbs.tcp8.cn/</link>
    </image>
    <item>
      <title>04.文件上传</title>
      <link>https://bbs.tcp8.cn/forum.php?mod=viewthread&amp;tid=583</link>
      <description><![CDATA[1、原理&amp;语法（见手册--杂项--上传,见手册--杂项--文件处理）文件上传本身支持上传各种类型的文件，包括图片、视频、压缩包等。比如：商城项目中商品都需要有图片展示，这些图片需要使用文件上传功能。文件上传功能的原理：将上传的文件保存到服务器指定位置；将服务器 ...]]></description>
      <category>thinkphp框架</category>
      <author>admin</author>
      <pubDate>Tue, 14 Jun 2022 14:06:14 +0000</pubDate>
    </item>
    <item>
      <title>03.TP中的验证码显示</title>
      <link>https://bbs.tcp8.cn/forum.php?mod=viewthread&amp;tid=582</link>
      <description><![CDATA[（见手册--杂项--验证码）









验证码包的位置：


①修改配置application\\config.php




②修改view/login/login.html 验证码图片img标签src属性





③点击刷新验证码图片


修改view/login/login.html，验证码图片img标签，绑定onclick事件，给src地址加随机 ...]]></description>
      <category>thinkphp框架</category>
      <author>admin</author>
      <pubDate>Tue, 14 Jun 2022 13:58:34 +0000</pubDate>
    </item>
    <item>
      <title>03.TP中的cookie和session</title>
      <link>https://bbs.tcp8.cn/forum.php?mod=viewthread&amp;tid=581</link>
      <description><![CDATA[（见手册--杂项--cookie，手册--杂项--session）TP框架提供了think\\Cookie类和think\\Session类分别操作cookie和session.也可以使用助手函数cookie()和session()。



session函数使用语法：











session函数基本操作
[mw_shl_code=php,true]session(\'name\', \'thi ...]]></description>
      <category>thinkphp框架</category>
      <author>admin</author>
      <pubDate>Tue, 14 Jun 2022 13:54:44 +0000</pubDate>
    </item>
    <item>
      <title>03.数据删除</title>
      <link>https://bbs.tcp8.cn/forum.php?mod=viewthread&amp;tid=580</link>
      <description><![CDATA[删除操作①先查询，再调用模型的delete方法删除





②先调用where方法，再调用Query类的delete方法删除





 ...]]></description>
      <category>thinkphp框架</category>
      <author>admin</author>
      <pubDate>Tue, 14 Jun 2022 13:49:53 +0000</pubDate>
    </item>
    <item>
      <title>03.数据的修改操作</title>
      <link>https://bbs.tcp8.cn/forum.php?mod=viewthread&amp;tid=579</link>
      <description><![CDATA[（见手册--模型--更新） (CURD:  create  update  read   delete)
1、更新一条数据



使用示例先查询再更新 和 直接更新 （save方法）





2、批量更新数据




以上用法通常比较少用，更多的批量更新，是使用where条件，一次更新多条数据的指定字段值。（多条数据的 ...]]></description>
      <category>thinkphp框架</category>
      <author>admin</author>
      <pubDate>Tue, 14 Jun 2022 13:47:12 +0000</pubDate>
    </item>
    <item>
      <title>02.模型的时间戳功能</title>
      <link>https://bbs.tcp8.cn/forum.php?mod=viewthread&amp;tid=578</link>
      <description><![CDATA[模型的时间戳功能（见手册--模型--时间戳）



注：自动写入时间戳字段，前提是数据表必须有对应的字段存在。]]></description>
      <category>thinkphp框架</category>
      <author>admin</author>
      <pubDate>Tue, 14 Jun 2022 13:41:19 +0000</pubDate>
    </item>
    <item>
      <title>02.数据的添加操作</title>
      <link>https://bbs.tcp8.cn/forum.php?mod=viewthread&amp;tid=577</link>
      <description><![CDATA[1、添加一条数据（save方法）




Save方法返回值是写入的记录数







2、静态方法添加（create方法）




添加数据使用示例：












3、添加多条数据（saveAll方法）








4、过滤非数据表字段

save方法：  调用save方法之前，先调用allowField方法





c ...]]></description>
      <category>thinkphp框架</category>
      <author>admin</author>
      <pubDate>Tue, 14 Jun 2022 13:39:13 +0000</pubDate>
    </item>
    <item>
      <title>02.其他查询方法</title>
      <link>https://bbs.tcp8.cn/forum.php?mod=viewthread&amp;tid=576</link>
      <description><![CDATA[1、where方法（查询语法）见手册--数据库--查询构造器--查询语法





注：where方法中，如果比较表达式是等于，可以省略这个参数。
应用示例： [mw ...]]></description>
      <category>thinkphp框架</category>
      <author>admin</author>
      <pubDate>Tue, 14 Jun 2022 13:32:04 +0000</pubDate>
    </item>
    <item>
      <title>02.查询一条数据</title>
      <link>https://bbs.tcp8.cn/forum.php?mod=viewthread&amp;tid=575</link>
      <description><![CDATA[1、获取一个数据（推荐静态调用find方法）
①静态调用get方法或者find方法

[mw_shl_code=php,true]//取出主键为1的数据  where id = 1

$user = \\app\\admin\\model%user::get(1);

$user = \\app\\admin\\model%user::find(1);

//使用数组查询(非主键字段),只能用get不能 ...]]></description>
      <category>thinkphp框架</category>
      <author>admin</author>
      <pubDate>Tue, 14 Jun 2022 13:10:16 +0000</pubDate>
    </item>
    <item>
      <title>02.查询多条数据</title>
      <link>https://bbs.tcp8.cn/forum.php?mod=viewthread&amp;tid=574</link>
      <description><![CDATA[查询多条数据（重点）
(见手册--模型--查询) 增删改查  (CURD  create  update  read  delete)注意：控制器中使用模型类，必须先引入模型类。




获取多个数据（推荐静态调用select方法）

①静态调用all方法或者select方法
[mw_shl_code=php,true]// 获取所有数据 al ...]]></description>
      <category>thinkphp框架</category>
      <author>admin</author>
      <pubDate>Mon, 13 Jun 2022 06:06:00 +0000</pubDate>
    </item>
    <item>
      <title>框架中的模型和数据库的配置</title>
      <link>https://bbs.tcp8.cn/forum.php?mod=viewthread&amp;tid=573</link>
      <description><![CDATA[1、导入数据表
tpshop.sql

新建tpshop数据库（create database tpshop character set utf8 collate utf8_general_ci）
导入数据表(source sql路径)


说明：如果导入sql文件时，有报错，提示类似“不能使用innodb”解决办法：打开mysql配置文件，修改如下
重启mysql即 ...]]></description>
      <category>thinkphp框架</category>
      <author>admin</author>
      <pubDate>Mon, 13 Jun 2022 02:32:19 +0000</pubDate>
    </item>
    <item>
      <title>01.将后台模板与框架做结合</title>
      <link>https://bbs.tcp8.cn/forum.php?mod=viewthread&amp;tid=572</link>
      <description><![CDATA[将后台模板与框架做结合网盘资源：
https://down.wz88.top:82/?f=%2F%E7%BC%96%E7%A8%8B%2Fphp
后台模板.zip
thinkphp_5.0.20_with_ext.zip
ThinkPHP5.0完全开发手册.CHM
01笔记.rar


模板整合思路：
①确定页面的访问路径（模块、控制器、方法）②新建对应的控制器方 ...]]></description>
      <category>thinkphp框架</category>
      <author>admin</author>
      <pubDate>Sun, 12 Jun 2022 09:25:40 +0000</pubDate>
    </item>
    <item>
      <title>01.视图</title>
      <link>https://bbs.tcp8.cn/forum.php?mod=viewthread&amp;tid=571</link>
      <description><![CDATA[视图的组成View视图类（继承了自定义模板引擎，功能与Smarty类似）HTML模板文件
模板的定义（见手册--模板--模板定位）为了对模板文件更加有效的管理，ThinkPHP对模板文件进行目录划分，默认的模板文件定义规则是：视图目录/控制器名（小写）/操作名（小写）+模板后缀默 ...]]></description>
      <category>thinkphp框架</category>
      <author>admin</author>
      <pubDate>Sun, 12 Jun 2022 06:49:34 +0000</pubDate>
    </item>
    <item>
      <title>01.Request请求类</title>
      <link>https://bbs.tcp8.cn/forum.php?mod=viewthread&amp;tid=570</link>
      <description><![CDATA[1、获取输入变量（见手册--请求--输入变量）要获取当前的请求信息，可以使用\\think\\Request类$request = \\think\\Request::instance();或者使用助手函数$request = request();也可以单独获取get变量或者post变量[mw_shl_code=php,true]Request::instance()-&gt;get();
Reque ...]]></description>
      <category>thinkphp框架</category>
      <author>admin</author>
      <pubDate>Sat, 11 Jun 2022 16:45:45 +0000</pubDate>
    </item>
    <item>
      <title>01.创建模块</title>
      <link>https://bbs.tcp8.cn/forum.php?mod=viewthread&amp;tid=569</link>
      <description><![CDATA[创建前台和后台模块一个典型的应用是由多个模块组成的（通常有前台网站模块和后台管理系统模块），这些模块通常都是应用目录下面的一个子目录，每个模块都有自己独立的配置文件、公共文件和类库文件。我们给项目创建home（前台）和admin（后台）两个模块：

2、设置默认 ...]]></description>
      <category>thinkphp框架</category>
      <author>admin</author>
      <pubDate>Sat, 11 Jun 2022 15:09:31 +0000</pubDate>
    </item>
    <item>
      <title>01.TP框架中的控制器</title>
      <link>https://bbs.tcp8.cn/forum.php?mod=viewthread&amp;tid=567</link>
      <description><![CDATA[1、控制器的后缀打开配置文件application/config.php，有如下配置



表示默认情况下，控制器无特殊后缀。例如 Index控制器，文件名为Index.php如果需要进行设置，可以设置为（我们不需要这么设置）[ ...]]></description>
      <category>thinkphp框架</category>
      <author>admin</author>
      <pubDate>Sat, 11 Jun 2022 06:38:07 +0000</pubDate>
    </item>
    <item>
      <title>01.TP框架基础</title>
      <link>https://bbs.tcp8.cn/forum.php?mod=viewthread&amp;tid=566</link>
      <description><![CDATA[目录结构（重点）（见手册--基础--目录结构）
[mw_shl_code=php,true]1.project  应用部署目录
 2.├─application           应用目录（可设置）
 3.│  ├─common             公共模块目录（可更改）
 4.│  ├─index              模块目录(可更改)
 5.│  │  ├ ...]]></description>
      <category>thinkphp框架</category>
      <author>admin</author>
      <pubDate>Sat, 11 Jun 2022 06:35:38 +0000</pubDate>
    </item>
    <item>
      <title>01.php中的主流框架</title>
      <link>https://bbs.tcp8.cn/forum.php?mod=viewthread&amp;tid=565</link>
      <description><![CDATA[①Zend Framework 框架，PHP官方框架。②YII框架，又叫易框架。③Symfony 框架。④Laravel框架，市场使用较多。⑤Codelgniter框架，简称CI框架。⑥ThinkPHP框架，简称TP框架，常用版本：3.2.3和 5.0.*版本。ThinkPHP是国人自己开发的框架。有中文官网、中文帮助文档、中 ...]]></description>
      <category>thinkphp框架</category>
      <author>admin</author>
      <pubDate>Sat, 11 Jun 2022 06:33:52 +0000</pubDate>
    </item>
  </channel>
</rss>