In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "what is the meaning of smart of php". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "what is the meaning of smart of php"?
The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer.
What does php smart mean?
Smarty is a template engine written in PHP and is one of the most famous PHP template engines in the industry. It separates logical code from external content, and provides an easy-to-manage and easy-to-use way to logically separate PHP code that would otherwise be mixed with HTML code.
To put it simply, the purpose is to separate the PHP programmer from the front-end staff, so that the programmer changes the logical content of the program will not affect the front-end staff's page design, and the front-end staff revising the page will not affect the program logic, which is particularly important in multi-person cooperation projects.
Advantages
1. Speed: programs written in Smarty can achieve maximum speed improvement, which is relative to other template engine technologies.
two。 Compiled: programs written in Smarty are compiled into a non-template PHP file at run time, which uses a mixture of PHP and HTML to convert WEB requests directly into this file the next time the template is accessed, without template recompilation (without changes to the source program)
3. Caching technology: a caching technology chosen by Smarty, which can cache the HTML file that the user finally sees into a static HTML page. When the cache attribute of Smarty is set to true, the user's WEB request will be directly converted to this static HTML file within the cachetime period set by Smarty, which is equivalent to calling a static HTML file.
4. Plug-in technology: Smarty can customize plug-ins. Plug-ins are actually custom functions.
5. If/elseif/else/endif can be used in templates. It is very convenient to rearrange the template format by using the judgment statement in the template file.
Places that are not suitable for using Smarty
Content that needs to be updated in real time. For example, stocks show that it needs to update the data frequently, and this type of program uses smarty to slow down template processing.
Small project. Small projects because the project is simple and both artists and programmers are one-person projects, the use of Smarty will lose the advantage of rapid PHP development to some extent.
(PS: but for the sake of the specification of the whole project, please try to use the template engine. In fact, accustomed to, the development speed will be faster, the above are the problems encountered by developers who are not used to the template engine)
At this point, I believe you have a deeper understanding of "what the smart of php means". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.