当前位置:网站首页>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
边栏推荐
- Deep learning plus
- 调查显示传统数据安全工具面对勒索软件攻击的失败率高达 60%
- Wsl2.0 installation
- Google Earth engine (GEE) -- a brief introduction to kernel kernel functions and gray level co-occurrence matrix
- 【剑指 Offer】61. 扑克牌中的顺子
- 网上办理期货开户安全吗?网上会不会骗子比较多?感觉不太靠谱?
- NPM installation
- Solve cmakelist find_ Package cannot find Qt5, ECM cannot be found
- 干货!半监督预训练对话模型 SPACE
- Facing new challenges and becoming a better self -- attacking technology er
猜你喜欢

composer安装报错:No composer.lock file present.

WR | 西湖大学鞠峰组揭示微塑料污染对人工湿地菌群与脱氮功能的影响

Games101 notes (I)

【刷題篇】鹅廠文化衫問題

Jarvis OJ Flag

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

Solution of vant tabbar blocking content
![[729. My schedule I]](/img/e3/32914227d00cf7595ee850e60f2b72.png)
[729. My schedule I]

Cs231n notes (bottom) - applicable to 0 Foundation
![[Jianzhi offer] 63 Maximum profit of stock](/img/b6/c1dec97a23ac13aa53d1d202b83ef5.png)
[Jianzhi offer] 63 Maximum profit of stock
随机推荐
JSON转MAP前后数据校验 -- 自定义UDF
Games101 notes (III)
[61dctf]fm
Benji Bananas 会员通行证持有人第二季奖励活动更新一览
What is ROM
Do sqlserver have any requirements for database performance when doing CDC
【729. 我的日程安排錶 I】
美国芯片傲不起来了,中国芯片成功在新兴领域夺得第一名
帮忙看看是什么问题可以吗?[ERROR] Could not execute SQL stateme
Basic introduction to the control of the row component displaying its children in the horizontal array (tutorial includes source code)
Is it safe to open an account for digging wealth stocks? How is it safe to open a stock account?
China Radio and television officially launched 5g services, and China Mobile quickly launched free services to retain users
[Jianzhi offer] 66 Build product array
【729. 我的日程安排表 I】
Embedded-c Language-1
【微信小程序】一文读懂小程序的生命周期和路由跳转
Games101 notes (I)
Twig数组合并的写法
[Jianzhi offer] 62 The last remaining number in the circle
PHP talent recruitment system development source code recruitment website source code secondary development