


Thinkphp, as an open source PHP framework, has developed to this day. It is undoubtedly the most suitable framework for PHP students to learn and use in China. In addition to being simple and easy to use, the greater advantage is the complete development documentation and rich plug-ins. To meet the conditions for developing a large and medium-sized website framework, "ThinkPHP5 Mall Project Practical Video Tutorial" will take the development of a medium-sized mall as an example and lead you to learn the core technology of Thinkphp.
Course playback address: http://www.php.cn/course/546.html
The teacher’s teaching style:
The teacher’s lectures are vivid, witty, witty, and touching. A vivid metaphor is like the finishing touch, opening the door to wisdom for students; a well-placed humor brings a knowing smile to students, like drinking a glass of mellow wine, giving people aftertaste and nostalgia; a philosopher's aphorisms, cultural references Proverbs are interspersed from time to time in the narration, giving people thinking and warning.
The more difficult point in this video is the design of the ThinkPHP infinite classification module:
Infinite classification and single classification are supported. Addition, deletion, modification and query are based on ThinkPHP operations. If you You can just change your own database operations. The module itself should not write the data layer in the module, but my project classification basically includes these operations, such as addition, deletion, modification, and search, so I wrote it directly in it. I didn’t want to Repeatedly write the code for adding, deleting, modifying, and checking.
I have also uploaded two tables here. Just change the table prefix to your own. This code of test.php can be used directly in one of the methods of a certain class in your project Lib.
public function catelist(){ $cate=D('Cate'); //var_dump($cate->gettree());exit; $cateres=$cate->gettree(); $this->assign('cateres',$cateres); $this->display(); }
The above is a very common database display api operation. Just display the database data. To design unlimited classification, first define a gettree method in the model layer
//商品分类中查询的公共方法---无限分类 public function gettree($p = 0,$lv = 0){ $t = array(); //循环打印数据表里面的数据,此时循环出来的是一个个一维数组 foreach ($this->select() as $k => $v) { //检查此时的数据的parent_id是否=0 if($v['parent_id'] == $p){ //子栏目缩进 $v['lv'] = $lv; //把数组赋值给$t $t[] = $v; //检查.合并array_merge $t = array_merge($t,$this->gettree($v['cate_id'],$lv+1)); } } return $t; }
Here we also recommend downloading source code resources:http://www.php.cn/xiazai/ learn/2118
1.3_Courseware
2.Source code
The above is the detailed content of ThinkPHP5 mall project practical video tutorial courseware source code sharing. For more information, please follow other related articles on the PHP Chinese website!

php把负数转为正整数的方法:1、使用abs()函数将负数转为正数,使用intval()函数对正数取整,转为正整数,语法“intval(abs($number))”;2、利用“~”位运算符将负数取反加一,语法“~$number + 1”。

实现方法:1、使用“sleep(延迟秒数)”语句,可延迟执行函数若干秒;2、使用“time_nanosleep(延迟秒数,延迟纳秒数)”语句,可延迟执行函数若干秒和纳秒;3、使用“time_sleep_until(time()+7)”语句。

php除以100保留两位小数的方法:1、利用“/”运算符进行除法运算,语法“数值 / 100”;2、使用“number_format(除法结果, 2)”或“sprintf("%.2f",除法结果)”语句进行四舍五入的处理值,并保留两位小数。

宝塔部署thinkphp5报错的解决办法:1、打开宝塔服务器,安装php pathinfo扩展并启用;2、配置“.access”文件,内容为“RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]”;3、在网站管理里面,启用thinkphp的伪静态即可。

判断方法:1、使用“strtotime("年-月-日")”语句将给定的年月日转换为时间戳格式;2、用“date("z",时间戳)+1”语句计算指定时间戳是一年的第几天。date()返回的天数是从0开始计算的,因此真实天数需要在此基础上加1。

php判断有没有小数点的方法:1、使用“strpos(数字字符串,'.')”语法,如果返回小数点在字符串中第一次出现的位置,则有小数点;2、使用“strrpos(数字字符串,'.')”语句,如果返回小数点在字符串中最后一次出现的位置,则有。

在PHP中,可以利用implode()函数的第一个参数来设置没有分隔符,该函数的第一个参数用于规定数组元素之间放置的内容,默认是空字符串,也可将第一个参数设置为空,语法为“implode(数组)”或者“implode("",数组)”。

php字符串有下标。在PHP中,下标不仅可以应用于数组和对象,还可应用于字符串,利用字符串的下标和中括号“[]”可以访问指定索引位置的字符,并对该字符进行读写,语法“字符串名[下标值]”;字符串的下标值(索引值)只能是整数类型,起始值为0。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SublimeText3 Linux new version
SublimeText3 Linux latest version

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version
Useful JavaScript development tools

SublimeText3 English version
Recommended: Win version, supports code prompts!
