当前位置:网站首页>thinkphp3.2.3
thinkphp3.2.3
2022-07-05 17:11:00 【qq_ forty-two million three hundred and seven thousand five hun】
https://www.thinkphp.cn/donate/download/id/610.html
After installation, the direct access will be in Application Generate home The directory contains the controllers and methods of the front desk. Let's talk about it here thinkphp Adopted mvc framework
m(model) Interacting with the database
v(view) View ,web Displayed page
c The controller is mainly some method functions
thinkphp mvc Use
Visit the home page
In fact, it accesses /index.php?m=home&c=index&a=index
index.php Is the entry file. All methods need it for transmission m=home&c=index&a=index representative home In the catalog index Controller index Method
You can also visit
index.php/home/index/index
We can try in index Write a under the controller test Method
<?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: " Microsoft YaHei "; 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> Welcome to use <b>ThinkPHP</b>!</p><br/> edition 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";
}
}
Visit Lu Jin
index.php/home/index/index/test
Try to home Create a new controller named test, The method inside is called index Print phpinfo Information
<?php
namespace Home\Controller;
use Think\Controller;
class TestController extends Controller {
public function index(){
phpinfo();
}
}
visit index.php/home/test/index
边栏推荐
猜你喜欢
随机推荐
Embedded-c Language-5
[first lecture on robot coordinate system]
stirring! 2022 open atom global open source summit registration is hot!
Embedded-c Language-2
Use JDBC technology and MySQL database management system to realize the function of course management, including adding, modifying, querying and deleting course information.
PHP人才招聘系统开发 源代码 招聘网站源码二次开发
Zhang Ping'an: accelerate cloud digital innovation and jointly build an industrial smart ecosystem
激动人心!2022开放原子全球开源峰会报名火热开启!
China Radio and television officially launched 5g services, and China Mobile quickly launched free services to retain users
EasyX second lesson
WSL2.0安装
高数 | 旋转体体积计算方法汇总、二重积分计算旋转体体积
Cs231n notes (bottom) - applicable to 0 Foundation
easyNmon使用汇总
[61dctf]fm
叩富网开期货账户安全可靠吗?怎么分辨平台是否安全?
Etcd build a highly available etcd cluster
Rider 设置选中单词侧边高亮,去除警告建议高亮
【729. 我的日程安排錶 I】
C# TCP如何设置心跳数据包,才显得优雅呢?