当前位置:网站首页>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
边栏推荐
- [61dctf]fm
- 项目引入jar从私服Nexus 拉去遇到的一个问题
- 【性能测试】jmeter+Grafana+influxdb部署实战
- 微信公众号网页授权登录实现起来如此简单
- 解决CMakeList find_package找不到Qt5,找不到ECM
- Precision epidemic prevention has a "sharp weapon" | smart core helps digital sentinels escort the resumption of the city
- Writing method of twig array merging
- Deep dive kotlin synergy (XXI): flow life cycle function
- 飞桨EasyDL实操范例:工业零件划痕自动识别
- C# TCP如何设置心跳数据包,才显得优雅呢?
猜你喜欢

深潜Kotlin协程(二十一):Flow 生命周期函数

Scratch colorful candied haws Electronic Society graphical programming scratch grade examination level 3 true questions and answers analysis June 2022

Clear restore the scene 31 years ago, volcanic engine ultra clear repair beyond classic concert

Solve cmakelist find_ Package cannot find Qt5, ECM cannot be found

Embedded-c Language-2

China Radio and television officially launched 5g services, and China Mobile quickly launched free services to retain users
![[61dctf]fm](/img/22/3e4e3f1679a27d8b905684bb709905.png)
[61dctf]fm

【Web攻防】WAF检测技术图谱

Android privacy sandbox developer preview 3: privacy, security and personalized experience
![[first lecture on robot coordinate system]](/img/3c/af056f0fe68b3244a3dc491ceb291d.png)
[first lecture on robot coordinate system]
随机推荐
Sentinel-流量防卫兵
如何将mysql卸载干净
How to install MySQL
dried food! Semi supervised pre training dialogue model space
SQL injection of cisp-pte (Application of secondary injection)
Flet tutorial 12 stack overlapping to build a basic introduction to graphic and text mixing (tutorial includes source code)
【剑指 Offer】62. 圆圈中最后剩下的数字
Basic introduction to the control of the row component displaying its children in the horizontal array (tutorial includes source code)
Embedded UC (UNIX System Advanced Programming) -2
[Web attack and Defense] WAF detection technology map
Sentinel flow guard
什么是ROM
[Jianzhi offer] 66 Build product array
Fleet tutorial 09 basic introduction to navigationrail (tutorial includes source code)
Wechat official account web page authorization login is so simple
时间戳strtotime前一天或后一天的日期
tf. sequence_ Mask function explanation case
Practical example of propeller easydl: automatic scratch recognition of industrial parts
The first EMQ in China joined Amazon cloud technology's "startup acceleration - global partner network program"
Application of threshold homomorphic encryption in privacy Computing: Interpretation