"Smarty Template Engine" will show you how to achieve code separation. smarty is one of the most famous PHP template engines in the industry. It separates logical code and external content, providing an easy-to-manage and use method to separate PHP code logic that is originally mixed with HTML code. Simply put, the purpose is to separate PHP programmers from front-end personnel so that the work of the two will not affect each other!
Play address: http://www.php.cn/course/636.html
This video was recorded by a teacher from Boer Education Xiling. The teacher has his own famous saying and style: Pretending is the primary productive force. If you don’t like to pretense, how can you have the motivation to learn? Lecture style: vivid and vivid, explaining complex computer concepts clearly through common things in life. Humorous language, simple explanation, clear organization, layer-by-layer analysis, interlocking, rigorous argumentation, rigorous structure, using the logical power of thinking to attract people Students' attention!
Then the more difficult points in the main course are: MVC and smarty
samrty: The main implementation is the separation of m and v,
samrty is The compiled template engine has its own unique syntax,
rich samrty functions:
Template nesting, reading setting files, variable preprocessing. Conditional judgment, loop control
smarty_inc.php inherits the class of smarty, that is to say, it is an inheritance class.
In the future, this inheritance class will be used directly instead of the samrty class.
The reason is that if you want to modify a certain parameter in the future, You only need to modify the method in smarty-inc. There is no need to modify every file
To facilitate future maintenance
MVC: In the large-scale development process, if you only separate m and v In terms of development, it is still not enough.
Because the web presentation layer needs to implement various output data,
These codes are mainly in M. In the end, M will become very complicated, with many conditional judgments such as if. , this will reduce the readability and maintainability of the program
In order to solve this contradiction, c is introduced. c mainly controls when to call the method in m, processes the input and output data, and finally displays it in v
mv: It is equivalent to the instinctive reaction of the human body and does not require brain processing. This is only suitable for simple development.
mvc:c is equivalent to the human brain. It can process the variables submitted by v. After being processed by c, it is submitted to m. In this way, it can handle more complex problems.
c can handle the more complex problems in the middle. Suitable for large-scale development
Here we provide you with video courseware download:http://www.php.cn/xiazai/code/2018
Courseware The following is about the process of learning Smarty template engine:
Learning smarty
Basic use
Basic usage
The problem of delimiter conflict
Judgment, looping, operation
Variables Features of regulators and template compilation
The difference between display and fetch
Cache
The above is the detailed content of Smarty template engine video teaching material course recommendations. For more information, please follow other related articles on the PHP Chinese website!