ThinkPHP

ThinkPHP特点
1、国内程序员开发
2、集成Smarty模板引擎
3、单一入口
4、自动生成项目目录

命名空间:虚似的文件夹(php5.3)
1、定义命名空间
namespace 空间名;
namespace aaa;
namespace aaa\bbb\ccc;
注意:定义命名空间的代码,必须出现在页面的第一行
2、导入命名空间下的某一个类
use 空间名\类名;
use aaa\Person;
use aaa\bbb\ccc\Person;
$对象 = new 空间\Person();

项目目录
library-----------------------第三方资源包
ThinkPHP
jquery
kindeditor
application-------------------应用程序
Common----------------------前后台公用文件
Common--------------------公用的公用函数
Conf
config.php--------------公用配置文件
Home------------------------模块目录
Common--------------------公用函数
Conf
config.php--------------配置文件
Controller----------------控制器
Model---------------------模型
View----------------------视图
Runtime---------------------运行时
public------------------------公用文件夹
images
css
index.php---------------------入口文件

控制器的命名规则
1、必须采用大驼峰的命名规则
2、必须以Controller.class.php来结尾
IndexController.class.php
LoginController.class.php

控制器中方法的命名规则
1、必须采用小驼峰的命名规则
login()
insert()
add()
index()
addUser()

定义命名空间的规则
namespace 模块名\目录名;
1、定义控制器的命名空间
namespace Home\Controller;
namespace Admin\Controller;
2、定义模型的命名空间
namespace Home\Model;
namespace Admin\Model;

通过命名空间导入类:library/ThinkPHP/Library/Think

use Think\Controller;
use Think\Model;
use Think\Page;

定义控制器的语法格式

IndexController.class.php
<?php
  namespace 模块名\Controller;
  use Think\Controller;

  class IndexController extends Controller
  {
     public function index()
     {
	逻辑处理代码;
	$this->assign(key,value);
	$this->assign(key,value);
	$this->assign(key,value);
	$this->display();
     }
  }
?>

display用法:
1、 t h i s − &gt; d i s p l a y ( &quot; a a a &quot; ) ; V i e w 控 制 器 a a a . h t m l 2 、 this-&gt;display(&quot;aaa&quot;); View 控制器 aaa.html 2、 this>display("aaa");Viewaaa.html2this->display();
View
控制器
方法.html

Think标签特点
1、标签的定界符:{}、<>
只有输出值的标签用的是{},其余标签用的都是<>
2、所有的<>标签,必须都是双标签
<标签></标签> <标签/>
3、只有输出值的标签、if标签、for标签,里面用到key名时,必须加$符号

Think标签
1、显示变量值
{KaTeX parse error: Expected 'EOF', got '}' at position 4: key}̲ 2、显示数组中某一个值 …key.下标}
{$key[下标]}
3、if标签
<if condition="条件">
内容
<elseif condition="条件"/>
内容
<else/>
内容
</if>
4、比较标签

   ==		eq
   !=           neq
   ===		heq
   !==          nheq
   <		lt
   <=		elt
   >		gt
   >= 		egt

5、switch标签

   <switch name="key">
     <case value="值">内容</case>
     <case value="值">内容</case>
     <case value="值">内容</case>
     <default/>内容
   </switch>

6、for标签

内容

7、foreach标签

下标:{KaTeX parse error: Expected 'EOF', got '}' at position 2: k}̲ 值:{v}

8、volist标签

序号:{KaTeX parse error: Expected 'EOF', got '}' at position 2: k}̲ 值:{v}

9、原样显示

Think标签

10、php标签

php代码;
php代码;
php代码;

11、包含html文件

公用html文件存储位置

View
  Public
    header.html
    footer.html
    success.html
<include file="文件夹:文件" />
<include file="Index:index" />
<include file="Public:header" />

配置文件
1、当前目录中的配置文件
application/Home/Conf/config.php
2、前后台公用的配置文件
application/Common/Conf/config.php
3、全局配置文件
library/ThinkPHP/Conf/convention.php
优先级:1 > 2 > 3
注意:
1、全局置文件,不建议修改
2、前后台相同的配置信息,存放到2
3、前后台不同的配置信息,存放到1

url路由(url访问方式)
1、url传参

   http://localhost/项目/index.php
   http://localhost/项目/index.php?c=控制器&a=方法
   http://localhost/项目/index.php?c=控制器&a=方法&名=值
   <a href="index.php?c=控制器&a=方法&名=值"></a>
   <link href="public/css/xxx.css">
   <img src="public/images/xxx.jpg">
   <script src="library/jquery/jquery-1.4.js">

2、pathinfo

   http://localhost/项目/index.php
   http://localhost/项目/index.php/控制器/方法.html
   http://localhost/项目/index.php/控制器/方法/名/值.html
   <a href="/项目/index.php/控制器/方法/名/值.html"></a>
   <link href="/项目/public/css/xxx.css">
   <img src="/项目/public/images/xxx.jpg">
   <script src="/项目/library/jquery/jquery-1.4.js">

ThinkPHP系统常量
APP:入口文件地址(链接地址、跳转地址)
ROOT:项目根目录(引入css、images、library)

总结:
1、入口文件
2、目录结构
3、控制器:命名规则、方法命名、命名空间、display
4、视图:存储位置、Think标签
5、配置文件
6、url路由、系统常量

执行sql语句:
1、执行select语句,返回:二维数组
$result = M()->query("select语句");
2、执行insert、update、delete语句,返回:受影响的行数
$result = M()->execute("insert|update|delete语句");

页面重定向
1、跳转页面
$this->redirect("控制器/方法");
$this->redirect("控制器/方法",array(名=>值,名=>值));
2、跳转页面,并提示信息
$this->redirect("控制器/方法",array(),时间,提示信息);
$this->redirect("Index/index",NULL,3,"删除记录成功!");

ThinkPHP框架
Model
View
Controller

项目目录
library
ThinkPHP
jquery
kindeditor
application
Common
Common
Conf
Admin
Common
Conf
Controller
Model
View
Home
Common
Conf
Controller
Model
View
Runtime
public
images
css
index.php
admin.php

入口文件编写

<?php
  header(...);

  define("APP_PATH","application/");
  define("BIND_MODULE","模块名");
  define("APP_DEBUG",true);
  define("BUILD_DIR_SECURE",true);

  include_once 'library/ThinkPHP/ThinkPHP.php';
?>

控制器的命名规则
1、必须采用大驼峰的命名规则
2、必须以Controller.class.php来结尾
IndexController.class.php
NewsController.class.php

方法的命名规则
1、必须采用小驼峰的命名规则
index()
delete()
del()

命名空间的命名规则

namespace 模块名\目录名;
namespace Home\Controller;
namespace Admin\Controller;
namespace Home\Model;
namespace Admin\Model;

导入系统类:library/ThinkPHP/Library/Think

use Think\Controller;
use Think\Model;
use Think\Page;
use Think\Upload;

定义控制器

IndexController.class.php
<?php
  namespace Home\Controller;
  use Think\Controller;

  class IndexController extends Controller
  {
     public function index()
     {
	逻辑处理;
	$this->assign(key,value);
	$this->assign(key,value);
	$this->assign(key,value);
	$this->display();
     }
  }
?>

display方法
1、$this->display("aaa");
View
控制器
aaa.html
2、$this->display();
View
控制器
方法.html

Think标签特点
1、标签定界符:{}、<>
只有输出值的标签用的是{}、其余标签用的都是<>
2、所有<>标签,必须都是双标签
<标签></标签>、<标签/>
3、只有输出值的标签、if标签、for标签,引用key名时必须加$

Think标签
1、显示变量值
{KaTeX parse error: Expected 'EOF', got '}' at position 4: key}̲ 2、显示数组中的某一个值 …key.下标}
{$key[下标]}
3、if标签

内容

内容

内容

4、switch标签

   <switch name="key">
     <case value="值">内容</case>
     <case value="值">内容</case>
     <case value="值">内容</case>
     <default/>内容
   </switch>

5、比较标签

   ==		eq
   !=   	neq
   ===		heq
   !==		nheq
   <		lt
   <=		elt
    >		gt
    > =		egt

6、for标签

内容

7、foreach标签

下标:{KaTeX parse error: Expected 'EOF', got '}' at position 2: k}̲ 值:{v}

8、volist标签

序号:{KaTeX parse error: Expected 'EOF', got '}' at position 2: k}̲ 值:{v}

9、php标签

php代码;

10、原样显示

Think标签

11、包含html文件

公用html文件存储位置
View
Public
header.html
footer.html
success.html

配置文件
1、当前目录中的配置文件
application/Home/Conf/config.php
2、公用的配置文件
application/Common/Conf/config.php
3、全局配置文件
library/ThinkPHP/Conf/convention.php
URL路由
1、url传参
http://localhost/项目/index.php
http://localhost/项目/index.php?c=控制器&a=方法
http://localhost/项目/index.php?c=控制器&a=方法&名=值
<a href="index.php?r=控制器&a=方法&名=值"></a>
<link href="public/css/xxx.css">
<img src="public/images/xxx.jpg">
<script src="library/jquery/jquery-1.4.js">
2、pathinfo
http://localhost/项目/index.php
http://localhost/项目/index.php/控制器/方法.html
http://localhost/项目/index.php/控制器/方法/名/值.html
<a href="__APP__/控制器/方法/名/值.html"></a>
<link href="__ROOT__/public/css/xxx.css">
<img src="__ROOT__/public/images/xxx.jpg">
<script src="__ROOT__/library/jquery/jquery-1.4.js">
模型的命名规则
1、必须采用大驼峰的命名规则
2、必须以表名来命名
3、必须以Model.class.php来结尾
BbsInfoModel.class.php
ReviewsModel.class.php
定义模型的语法格式
BbsInfoModel.class.php

<?php namespace Home\Model; use Think\Model; class BbsInfoModel extends Model { public $tableName = "省略了前缀的表名"; public $trueTableName = "完整的表名"; } ?>

获得模型对象的方法

$model = D("模型名");//必须新建一个模型文件
$model = D("表名");//不用新建模型文件
$model = M("表名");//不用新建模型文件

注意:表名必须全部小写
说明:
1、Windows系统下MySQL不区分大小写
2、Linux系统下MySQL区分大小写(建表时,表名全部小写)

create table bbsinfo
()
$bbsInfo = M("bbsinfo")->select();

数据库操作
1、查询多条记录,返回:二维数组

   $result = $model->select();
   $result = $model->field()->select();
   $result = $model->where()->select();
   $result = $model->order()->select();
   $result = $model->limit()->select();
   $result = $model->field()->where()->order()->limit()->select();

2、删除记录,返回:受影响的行数

   $result = $model->delete();
   $result = $model->where()->delete();

3、添加记录,返回:主键值(主键自增长)、受影响的行数(主键不是自增长)

   $result = $model->add(一维关联的数组);
   $result = $model->data(一维关联的数组)->add();

4、查询一条记录,返回:一维关联数组

   $result = $model->find();
   $result = $model->field()->find();
   $result = $model->where()->find();

5、修改记录,返回:受影响的行数

   $result = $model->save(一维关联数组);
   $result = $model->where()->save(一维关联数组);

6、执行select语句,返回:二维数组

$result = M()->query("select语句");
7、执行insert、update、delete语句,返回:受影响的行数
$result = M()->execute("insert|update|delete语句");
8、聚合查询,返回:数字

   $result = $model->where()->count();
   $result = $model->where()->sum(字段);
   $result = $model->where()->avg(字段);
   $result = $model->where()->max(字段);
   $result = $model->where()->min(字段);

9、多表查询

   $result = $model->join("多表查询")->select();
   $result = $model->join("多表查询")->find();
   $newsInfo = M("newsarticles")->join("newstypes on newsarticles.typeId=newstypes.typeId")->select();

10、修改一个指定的字段
$result = $model->where()->save(一维关联数组);
$result = $model->where()->setField("字段名","字段值");
11、查询一个指定的字段
$result = $model->where()->getField("字段名");
12、让字段值递增
$result = $model->where()->setInc("字段名");//让字段值加1
$result = $model->where()->setInc("字段名",3);//让字段值加3
13、让字段值递减
$result = $model->where()->setDec("字段名");//让字段值减1
$result = m o d e l − &gt; w h e r e ( ) − &gt; s e t D e c ( &quot; 字 段 名 &quot; , 3 ) ; / / 让 字 段 值 减 3 ‘ 获 得 u r l 中 的 参 数 1 、 通 过 model-&gt;where()-&gt;setDec(&quot;字段名&quot;,3);//让字段值减3` 获得url中的参数 1、通过 model>where()>setDec("",3);//3url1_GET获得
$变量 = G E T [ &quot; 参 数 名 &quot; ] ; 2 、 给 控 制 器 中 的 方 法 加 参 数 p u b l i c f u n c t i o n 方 法 ( _GET[&quot;参数名&quot;]; 2、给控制器中的方法加参数 public function 方法( GET[""];2publicfunction(参数名,$参数名…)
{}
页面重定向
1、跳转页面

   $this->redirect("控制器/方法");
   $this->redirect("控制器/方法",array(名=>值,名=>值...));
   $this->redirect("Login/index");
   $this->redirect("index.php?c=控制器&a=方法");

2、跳转页面,并提示信息
$this->redirect("控制器/方法",array(),3,提示信息);
$this->redirect("控制器/方法",NULL,3,提示信息);
系统提示信息页面
1、提示成功的方法
$this->success("提示信息","跳转地址");
2、提示失败的方法
$this->error("提示信息","跳转地址");
自定义success页面
1、在View/Public新建一个success.html页面
2、success.html上标签
{KaTeX parse error: Expected 'EOF', got '}' at position 8: message}̲:提示信息 {jumpUrl}:跳转地址
3、修改配置文件
'TMPL_ACTION_ERROR' => 'Public:success',
'TMPL_ACTION_SUCCESS' => 'Public:success',

ThinkPHP框架
模型的命名规则
1、必须采用大驼峰的命名规则
2、必须以表名来命名
3、必须以Model.class.php来结尾
BbsInfoModel.class.php
ReviewsModel.class.php
定义模型的语法格式

BbsInfoModel.class.php
<?php
  namespace Home\Model;
  use Think\Model;

  class BbsInfoModel extends Model
  {
     public $tableName = "省略了前缀的表名";
     public $trueTableName = "完整的表名";
  }
?>

获得模型对象
$model = D(“模型名”);//必须新建模型文件
$model = D(“表名”);//不用新建模型
$model = M(“表名”);//不用新建模型
注意:表名必须全部小写
建议:linux下建表时,表名全部小写
数据库操作
1、查询多条记录,返回:二维数组

   $result = $model->select();
   $result = $model->field()->select();
   $result = $model->where()->select();
   $result = $model->order()->select();
   $result = $model->limit()->select();
   $result = $model->join()->select();

2、查询一条记录,返回:一维关联数组

   $result = $model->find();
   $result = $model->where()->find();
   $result = $model->field()->find();
   $result = $model->join()->find();

3、添加记录,返回:主键值、受影响的行数
$result = $model->add(一维关联数组);
result = $model->data(一维关联数组)->add();
4、删除记录,返回:受影响的行数
$result = $model->delete();
$result = $model->where()->delete();
5、修改记录,返回:受影响的行数
$result = $model->save(一维关联数组);
$result = $model->where()->save(一维关联数组);
6、聚合查询,返回:数字

   $result = $model->where()->count();
   $result = $model->where()->sum(字段);
   $result = $model->where()->avg(字段);
   $result = $model->where()->max(字段);
   $result = $model->where()->min(字段);

7、执行select语句,返回:二维数组
$result = M()->query("select语句");
8、执行insert、update、delete语句,返回:受影响的行数
$result = M()->execute("insert|update|delete语句");
获得url中参数的方法
1、通过$_GET来获得
$变量 = $_GET[“参数名”];
2、给控制器的方法加参数

   public function 方法($参数名,$参数名...)
   {}

页面重定向(跳转页面)
1、跳转页面
t h i s − &gt; r e d i r e c t ( &quot; 控 制 器 / 方 法 &quot; ) ; ‘ this-&gt;redirect(&quot;控制器/方法&quot;); ` this>redirect("/");this->redirect(“控制器/方法”,array(名=>值,名=>值…));2、跳转页面,并提示信息 t h i s − &gt; r e d i r e c t ( &quot; 控 制 器 / 方 法 &quot; , a r r a y ( ) , 时 间 , 提 示 信 息 ) ; ‘ ‘ this-&gt;redirect(&quot;控制器/方法&quot;,array(),时间,提示信息);` ` this>redirect("/",array(),,);this->redirect(“控制器/方法”,NULL,时间,提示信息);系统提示信息页面 1、提示成功的方法$this->success(提示信息,跳转地址);2、提示失败的方法 KaTeX parse error: Expected '}', got 'EOF' at end of input: …s.html显示的值 {message}:提示信息
{$jumpUrl}:跳转地址
3、修改配置文件
"TMPL_ACTION_SUCCESS"=>"Public:success",
"TMPL_ACTION_ERROR"=>"Public:success",
分页类:library/ThinkPHP/Library/Think/Page.class.php
1、导入分页类
use Think\Page;
2、实例化分页类
p a g e = n e w P a g e ( 总 记 录 数 , 每 页 显 示 的 记 录 数 = 20 ) ; 3 、 分 页 类 的 属 性 ‘ page = new Page(总记录数,每页显示的记录数=20); 3、分页类的属性 ` page=newPage(,=20);3page->firstRow;//每页记录起始值$page->listRows;//每页显示的记录数4、分页类的方法 $page->show();//返回分页栏`

验证码类:library/ThinkPHP/Library/Think/Verify.class.php
1、导入验证码类
use Think\Verify;
2、在控制器中添加一个方法,制做验证码

   $verify = new Verify();
   $verify->length = 字的个数;
   $verify->fontSize = 字的大小;
   $verify->entry();

3、比对验证码
$verify = new Verify();
$result = $verify->check("用户输入的验证码");
网站的架构模式
Client/Server:客户端服务器模式
Browser/Server:服务器模式

表单验证:php
1、新建一个模型文件
2、在模型中添加一个属性,定义验证的规则
public $_validate = array(
array(“表单元素名”,“验证规则”,“提示信息”),
array(“表单元素名”,“验证规则”,“提示信息”),
array(“表单元素名”,“验证规则”,“提示信息”)
);
3、表单提交时,在控制器中进行验证

   $model = D("模型名");
   if($model->create())
   {
      //表单验证通过
   }
   else
   {
      $msg = $model->getError();//错误提示信息
      $this->success();
      $this->redirect();
   }

计算机中文件大小的单位(1024的换算关系)
B
K
M
G
T

文件上传类:library/ThinkPHP/Library/Think/Upload.class.php
1、导入上传类
use Think\Upload;
2、编写上传的代码

   //实例化上传类
   $upload = new Upload();
   //设置允许上传的文件类型
   $upload->exts = array("jpg","gif");
   //设置允许上传的最大文件
   $upload->maxSize = 10000000;
   //是否生成子目录
   $upload->autoSub = false;
   //保存文件的根目录
   $upload->rootPath = "./";
   //保存路径
   $upload->savePath = "public/upfile/";
   //上传文件
   $myFile = $_FILES["myFile"];
   $result = $upload->uploadOne($myFile);
   if($result)
   {
	print_r($result);
   }
   else
   {
	$msg = $upload->getError();//上传的错误信息
	$this->success($msg,__APP__."/Upload1/index");
   }

3、php.ini与上传相关的配置
1)php环境是否支持文件上传
file_uploads = On|Off
2)上传文件临时存储目录(默认:系统的临时目录)
upload_tmp_dir = "c:/hello"
3)开发环境允许上传的最大文件大小
upload_max_filesize = 2M
4)最多允许上传的文件的数量
max_file_uploads = 20
5)post表单最大提交的数据量
post_max_size = 8M
6)最大占用的内存
memory_limit = 128M
文件上传的过程:表单提交->服务器内存->临时目录->指定的存储目录
Common用法:公用函数
1、在Common文件夹下新建一个function.php
2、function.php系统自动加载(function.php文件名固定)
3、控制器、视图都可以直接调用公用函数
控制器调用公用函数
函数名();
函数名(值,值…);
KaTeX parse error: Expected '}', got 'EOF' at end of input: …配合输出值的标签来使用 {key|函数名}
{ k e y , key, key,key|函数名}
{KaTeX parse error: Expected 'EOF', got '}' at position 11: key.下标|函数名}̲ {key[下标]|函数名}
总结:
1、分页类
2、验证码类
3、表单验证
4、文件上传类
5、Common

分页类
1、导入分页类
use Think\Page;
2、实例化分页类
$page = new Page(总记录数,每页记录数=20);
3、属性
$page->firstRow;
$page->listRows;
4、方法
$page->show();
验证码类
1、导入验证码类
use Think\Verify;
2、显示验证码
$verify = new Verify();
$verify->length = 字符个数;
$verify->fontSize = 字符大小;
$verify->entry();
3、比对验证码
$verify = new Verify();
$result = $verify->check("用户输入的验证码");
表单验证
1、新建一个模型文件
2、在模型中添加如下属性

   public $_validate = array(
      array("表单元素名","验证规则","提示信息"),
      array("表单元素名","验证规则","提示信息"),
      array("表单元素名","验证规则","提示信息"),
      array("表单元素名","验证规则","提示信息"),
      array("表单元素名","验证规则","提示信息")
   );

3、在控制器中添加如下代码,进行验证
m o d e l = D ( &quot; 模 型 名 &quot; ) ; i f ( model = D(&quot;模型名&quot;); if( model=D("");if(model->create())
{
//验证通过
//1、比对验证码
//2、判断用户名、密码是否正确
}
else
{
//验证失败
$msg = $model->getError();
}
文件上传类
1、导入上传类
use Think\Upload;
2、上传功能

   $upload = new Upload();
   $upload->exts = array("扩展名","扩展名"...);
   $upload->maxSize = 数字;
   $upload->autoSub = 布尔值;
   $upload->rootPath = "./";
   $uplaod->savePath = "public/upfile/";
   $result = $upload->uploadOne($_FILES["名"]);//上传一个文件
   $result = $upload->upload();//上传多个文件

Common公用函数
1、在Common文件夹下新建一个function.php
2、function.php是由系统自动加载(function.php文件名固定)
3、控制器、视图调用函数
1)控制器:通过函数名直接调用
函数名();
函数名(值,值…);
KaTeX parse error: Expected '}', got 'EOF' at end of input: …出值的标签来调用 {key|函数名}
{ k e y , key, key,key…|函数名}

缓存Cache:提高网站的访问效率
缓存分类
1、按缓存数据存储位置不同
1)文件缓存
2)内存缓存
2、按缓存数据量不同
1)整站缓存
2)页面缓存
3)局部缓存(片段缓存)
4)局部不缓存
5)数据缓存(变量缓存)

ThinkPHP缓存:文件缓存、数据缓存(变量缓存)
1、快捷缓存
1)向缓存中添加数据
S(名,值,缓存时间);
2)从缓存中取数组
$变量 = S(名);
3)删除缓存中指定数据
S(名,NULL);
2、快速缓存
1)向缓存中添加数据
F(名,值);
2)从缓存中取数组
$变量 = F(名);
3)删除缓存中指定数据
F(名,NULL);
3、查询缓存

  $result = $model->cache(true,时间)->select();
  $result = $model->cache(true,时间)->find();

ThinkPHP知识点
1、介绍、特点
2、版本
3、目录结构
4、入口文件
5、控制器
1)命名规则
2)方法命名规则
3)命名空间的命名规则
4)定义语法格式
5)display方法
6、视图
1)存储位置
2)Think标签
3)公用html存储位置
7、配置文件
1)当前目录中的配置文件
2)公用的配置文件
3)全局配置文件
8、url路由
1)url传参
2)pathinfo
9、系统常量
APP
ROOT
10、模型
1)模型命名规则
2)定义语法格式
3)获得模型对象:D()、M()
4)数据库操作
11、页面重定向
$this->redirect()
12、系统提示信息页面
$this->success();
$this->error();
自定义success页面
13、系统类
1)分页类
2)验证码类
3)上传类
14、表单验证
15、Common
16、缓存
17、后台管理

abstract class Controller
{}
class BaseController extends Controller
{查询所有分类}
class IndexController extends BaseController
{}


class 父类
{
  public function __construct()
  {
     if(method_exists($this,"_initialize"))
        $this->_initialize();
  }
}
class 子类 extends 父类
{
  //相当于构造函数
  public function _initialize()
  {
     echo "大家好";
  }
}
$对象 = new 子类();

if语句后边的{}
if(条件)
代码;
if(条件)
{
代码;
}
注意:if下边只有一句代码时,那么{}才可以省略
建议:在任何情况下都不要省略{}

视图调用公用函数
{KaTeX parse error: Expected 'EOF', got '}' at position 8: key|函数名}̲ {key[“下标”]|函数名}

http://localhost/news/index.php/Search/search
第一页的数据: s e a r c h T y p e 、 searchType、 searchTypekeyword—>POST提交
点击页码:点击超链接
http://localhost/news/index.php/Search/search/p/3.html

M(表)->where("{KaTeX parse error: Expected 'EOF', got '}' at position 11: searchType}̲ like '%{key}%’")->select();

http://localhost/news/index.php
/Search/search/searchType/content/keyword/%E5%8C%97%E4%BA%AC/p/2.html

http://localhost/news/index.php/News/index/articleId/9.html

http://localhost/news/index.php/News/reviews

ThinkPHP知识点
1、目录结构
2、入口文件
3、控制器
4、视图
5、模型
6、配置文件
7、页面重定向
8、系统提示信息
9、分页类、验证码类、文件上传类
10、表单验证
11、Common用法
12、缓存
13、后台管理

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值