Home  >  Article  >  Backend Development  >  I don’t know how to use PHP Smarty template, MVC framework pattern, thinkPHP framework, it’s so troublesome! !

I don’t know how to use PHP Smarty template, MVC framework pattern, thinkPHP framework, it’s so troublesome! !

WBOY
WBOYOriginal
2016-10-17 09:30:21878browse

Beginners:
After learning PHP Smarty template, MVC framework pattern, and thinkPHP framework, I feel that making a website is very troublesome and confusing to use. I don’t know how to layout a website and how to use modular design. Dear experts, please give me your learning experience! ! !
In the past, I directly changed the front-end HTML to PHP. It is easy to understand and apply, and I don’t find it troublesome. I also know that future projects will have to be designed quickly, but I feel that it will not be done in an instant. Please solve it

Reply content:

Beginners:
After learning PHP Smarty template, MVC framework pattern, and thinkPHP framework, I feel that making a website is very troublesome and confusing to use. I don’t know how to layout a website and how to use modular design. Dear experts, please give me your learning experience! ! !
In the past, I directly changed the front-end HTML to PHP. It is easy to understand and apply, and I don’t find it troublesome. I also know that future projects will have to be designed quickly, but I feel that it will not be done in an instant. Please solve it

Controller The controller just needs to focus on data and logic (backend)
View The template just needs to focus on data display and page layout (frontend)
Model Just focus on database interaction (backend) )

First separate these three layers.

There is also a modular setting in TP, and each module can complete some unique functions, such as:

  • User module focuses on user registration, login, password retrieval, data editing, social login verification, etc.,

  • Invoice module focuses on completing the creation, display, modification, etc. of orders,

  • Payment module focuses on unified collection, order payment, order refund, etc.

Each module has its own Model View Controller .

Multiple modules can form your own APP, which is your website.

The above three modules plus one Product module can form a basic mall APP.

Thinkphp’s documentation is relatively detailed and suitable for Chinese people to read

As long as you understand PHP syntax, have a deep understanding of MVC, read it patiently, and type the sample code, you can write a CURD application in basically 1-2 weeks

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn