ThinkPHP in Action cover

ThinkPHP in Action

No rating yet
Word count
371 words
Chapters
26
ISBN
9787302466529

Tags

Summary

ThinkPHP in Action, written by Xia Lei and published by Tsinghua University Press in April 2017, is a hands-on tutorial on the ThinkPHP framework for PHP developers. The book has 14 chapters, each a fairly self-contained set of topics that readers can consult as needed and study in blocks. It covers the framework's essentials and development environment setup, configuration system, routing, controllers, models, template engine, database operations, and other common modules and practical techniques, and ties them together with MySQL database design and application to walk through a complete web project development workflow. The book includes abundant sample code and detailed comments to help readers understand and get started. Finally, four complete projects—a message board, a blog system, a forum, and a WeChat official account—demonstrate every stage of a web application, from requirements design and coding to deployment, helping readers turn scattered knowledge into reusable project experience. At about 371,000 Chinese characters and 216 pages of main text, it suits developers who already know PHP and want to advance to the framework level, and can also serve as a textbook or reference for colleges and training institutions.

Editor's review

这本书适合已经会写PHP、但在项目里“不知道该从哪里下手”的开发者。很多PHP入门书止步于语法,读者学完却做不出一个像样的网站;本书直接切到框架层面,把ThinkPHP中最常用的配置、路由、控制器、模型串成一条线,每个环节都配有可直接运行的示例与注释。 结构上用“14章独立知识点+4个完整项目”搭配,前者可当手册按需翻查,后者可以跟着从头做一遍,走完需求设计、编码实现到运行部署的全过程。留言板、博客、论坛、微信公众号这几个项目都是国内Web开发中最常见的形态,改造后可直接用于实际工作。 需要提醒的是,本书2017年出版,对应的ThinkPHP版本与PHP环境较老,部分代码在ThinkPHP 6/8等新版本下需要调整。因此建议把它当作框架思路与项目组织的学习材料,而非照抄的代码库;如需在新版本上开发,配合官方文档阅读效果更佳。

Who it's for

A good fit for

  • 已掌握PHP语法基础、想学习框架开发的在读学生与自学者
  • 需要快速上手ThinkPHP、承接中小型Web项目的初中级程序员
  • 讲授PHP框架课程的大中专院校教师与培训机构讲师
  • 从前端或其他语言转做PHP全栈开发、想了解MVC项目组织的开发者

Not a good fit for

  • 完全零编程基础、尚未写过PHP代码的读者
  • 只使用ThinkPHP 6/8最新版本、要求代码即抄即用的开发者
  • 已能独立架构大型PHP分布式系统的高级工程师

Reading tips

  1. 先按第1至第5章顺序打通环境搭建、配置、路由、控制器、模型的完整链路,再按兴趣跳读后续章节。
  2. 边读边敲代码,用UPUPW或LNMP自行搭建本地环境,每章示例跑通后再往下学。
  3. 把四个实战项目至少完整跟做一个,练习从设计表结构到部署上线的全流程。
  4. 开发新项目时对照ThinkPHP官方新版本文档,注意版本差异带来的写法变化。

About the publisher

Tsinghua University Press China · Founded in 1980

Founded in 1980, Tsinghua University Press has 57 titles in our collection, covering popular science, medicine, health, law, philosophy and social sciences. Representative works include medical popular-science books such as Cancer Truth: Doctors Are Reading It Too and New Knowledge on Cancer by Bo Luo (Li Zhizhong), legal titles such as Sunshine Is the Best Preservative: Express Delivery of Major Global Anti-Corruption Cases, and works like Qi Ge's A Brief History of Philosophy with Big Ideas and Liu Yunhao's From the Internet to a New Industrial Revolution. Its authors include science writers, medical researchers, the Renmin University of China anti-corruption master's class and university scholars, reflecting a publishing profile that balances academic seriousness with accessible reading. As public information is limited, this profile is based only on the titles in our collection.

Contents

  1. Chapter 1 Getting Started with ThinkPHP
  2. 1.1 Overview of the MVC Pattern
  3. 1.2 What Is ThinkPHP
  4. 1.3 Setting Up a PHP Development Environment (UPUPW, PHPStorm, Virtual Hosts)
  5. 1.4 Your First ThinkPHP Program
  6. 1.5 Application Structure Explained (Directories, Entry File, Modules, Controllers)
  7. Chapter 2 Configuration
  8. 2.1 Configuration Types (Default, Common, Mode, Debug, Scenario, Module, Extension, Dynamic)
  9. 2.2 Configuration Operations (The C Function, Reading, Loading Extension Configuration, Writing)
  10. Chapter 3 Routing
  11. 3.1 The Three URL Modes (Dynamic, Static, Pseudo-static)
  12. 3.2 ThinkPHP Routing (Routing Modes, Route Configuration)
  13. Chapter 4 Controllers
  14. 4.1 Defining a Controller
  15. 4.2 Before and After Actions
  16. 4.3 Action Parameter Binding
  17. 4.4 Pseudo-static and URL Case Sensitivity
  18. 4.6 URL Generation (Address Expressions, Parameters, Pseudo-static Suffixes, Route Addresses)
  19. 4.7 Ajax Responses
  20. 4.8 Redirects and Page Jumps
  21. 4.9 HTTP Request Methods and Reading Input
  22. 4.11 Empty Actions and Empty Controllers
  23. Chapter 5 Models
  24. 5.1 Preparation
  25. 5.2 Defining a Model
  26. 5.3 Instantiating a Model

FAQ

这本书对应ThinkPHP的哪个版本?
本书2017年出版,内容基于当时主流的ThinkPHP 5系列(如路由、配置、模块等写法),与ThinkPHP 6及之后的版本差异较大。学习框架思路可以参考,但实际开发需以官方最新文档为准。
没有PHP基础能直接读吗?
不太建议。书中默认读者已会PHP基本语法与MySQL基础,直接进入框架与项目讲解,零基础读者容易卡在环境与语法细节上,建议先补一门PHP入门教程。
书里的项目示例是哪些?
据出版信息,书中通过留言板、博客系统、论坛开发、微信公众号四个完整项目,演示Web应用从设计到运行的各环节,覆盖国内Web开发常见形态。
这本书有新版吗?
该书2017年由清华大学出版社出版,市面上另有作者同系列的《ThinkPHP 5实战》等后续作品。选购时请核对ISBN 9787302466529,避免买错版本。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

About the author

夏磊 Author

Xia Lei is a book author about whom limited public information is available. The only work currently attributed to this name is Photoshop CC: From Beginner to Mastery (Full-Color Value Edition), a title in the software-learning category aimed at readers who want to master Photoshop CC operations systematically. Judging from this work, Xia Lei's writing leans toward practical reference books: software functions serve as the thread, supported by full-color illustrations and step-by-step instructions that help beginners move from basic entry to fuller skills. The book follows a progressive from-beginner-to-mastery structure, covering interface familiarity, tool use, and hands-on case exercises, making it suitable for self-study and classroom reference. Since the author's personal background and professional experience are not publicly disclosed, no speculation is made here; this introduction is based solely on the available work and category information.

More by the same author

Top rated in the same category