当前位置:网站首页>thinkphp3.2.3
thinkphp3.2.3
2022-07-05 16:28:00 【qq_42307546】
https://www.thinkphp.cn/donate/download/id/610.html
安装完成后直接访问会在Application生成home目录里面包含前台的控制器和方法这里说下thinkphp采用的mvc架构
m(model)与数据库交互
v(view)视图,web所展示的页面
c控制器主要是一些方法功能
thinkphp mvc的使用
访问首页
实际上它访问的/index.php?m=home&c=index&a=index
index.php是入口文件所有的方法都需要它进行传输m=home&c=index&a=index代表home目录下的index控制器的index 方法
也可以这样访问
index.php/home/index/index
我们可以尝试在index控制器下写一个test方法
<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
public function index(){
$this->show('<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:)</h1><p>欢迎使用 <b>ThinkPHP</b>!</p><br/>版本 V{$Think.version}</div><script type="text/javascript" src="http://ad.topthink.com/Public/static/client.js"></script><thinkad id="ad_55e75dfae343f5a1"></thinkad><script type="text/javascript" src="http://tajs.qq.com/stats?sId=9347272" charset="UTF-8"></script>','utf-8');
}
public function test(){
echo "This is test";
}
}
访问路劲
index.php/home/index/index/test
尝试在home目录下在创建一个新的控制器名字为test,里面的方法名为index打印phpinfo信息
<?php
namespace Home\Controller;
use Think\Controller;
class TestController extends Controller {
public function index(){
phpinfo();
}
}
访问index.php/home/test/index
边栏推荐
- 【729. 我的日程安排表 I】
- Jarvis OJ 远程登录协议
- Browser rendering principle and rearrangement and redrawing
- American chips are no longer proud, and Chinese chips have successfully won the first place in emerging fields
- Raspberry pie 4B installation pytorch1.11
- Clear restore the scene 31 years ago, volcanic engine ultra clear repair beyond classic concert
- 【机器人坐标系第一讲】
- Google Earth Engine(GEE)——Kernel核函数简单介绍以及灰度共生矩阵
- Facing new challenges and becoming a better self -- attacking technology er
- Jarvis OJ Webshell分析
猜你喜欢

NPM installation

Jarvis OJ simple network management protocol

【剑指 Offer】63. 股票的最大利润

Deep learning plus
![[team PK competition] the task of this week has been opened | question answering challenge to consolidate the knowledge of commodity details](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[team PK competition] the task of this week has been opened | question answering challenge to consolidate the knowledge of commodity details

【jmeter】jmeter脚本高级写法:接口自动化脚本内全部为变量,参数(参数可jenkins配置),函数等实现完整业务流测试

Embedded-c Language-1

调查显示传统数据安全工具面对勒索软件攻击的失败率高达 60%

Embedded UC (UNIX System Advanced Programming) -2

How to uninstall MySQL cleanly
随机推荐
麻烦问下,DMS中使用Redis语法是以云数据库Redis社区版的命令为参考的嘛
中国广电正式推出5G服务,中国移动赶紧推出免费服务挽留用户
C# TCP如何限制单个客户端的访问流量
齐宣王典故
【jmeter】jmeter脚本高级写法:接口自动化脚本内全部为变量,参数(参数可jenkins配置),函数等实现完整业务流测试
BS-XX-042 基于SSM实现人事管理系统
PHP 严格模式
Use JDBC technology and MySQL database management system to realize the function of course management, including adding, modifying, querying and deleting course information.
时间戳strtotime前一天或后一天的日期
Games101 notes (I)
机器学习编译第2讲:张量程序抽象
采用药丸屏的iPhone14或引发中国消费者的热烈抢购
【剑指 Offer】62. 圆圈中最后剩下的数字
Sentinel flow guard
What else do you not know about new map()
Embedded UC (UNIX System Advanced Programming) -1
Games101 notes (III)
Use byte stream to read Chinese from file to console display
How can C TCP set heartbeat packets to be elegant?
树莓派4b安装Pytorch1.11