Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What template engines does php have?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains what template engines php has. Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what template engines php has!

PHP is a HTML embedded scripting language that executes on the server side, so the initial development template for most Web applications developed by PHP is mixed-layer data programming. Although the application logic can be forcibly separated from the web presentation logic through the MVC design pattern, it only separates the input, processing and output of the application, and the web rendering logic (view) will be strongly coupled with HTML code and PHP programs.

Types

There are many mature templates that can be applied in PHP, such as Smarty, PHPLIB, IPB, xingTemplate and so on. Using these template engines written through PHP can make your code clearer and more reasonable in structure. It can also make it easier to maintain and update the website, create a better development environment, and make it easier to combine development and design work. However, for a PHP programmer, no PHP template is the most suitable and perfect for him. Because PHP templates are popular things, not developed for anyone. If we can have a clear understanding of the characteristics and application of the template, and fully realize the advantages and disadvantages of the template, we can know whether to choose to use the template or which template to use.

1 、 smarty

Smarty is a PHP template engine developed based on PHP. It provides the separation of logic and external content, to put it simply, the purpose is to use PHP programmers to separate from artists, the programmers used to change the logical content of the program will not affect the page design of artists, and re-modification of the page by artists will not affect the program logic of the program, which is particularly important in multi-person cooperation projects.

2 、 Template Lite

Template Lite is a very fast and small HTML template engine. The engine supports most of the features and filters of the Smarty template engine.

3 、 TinyButStrong

TinyButStrong (TBS) is a PHP template engine that allows clean separation of PHP scripts and HTML files. TBS is designed to be able to use any visual HTML editor to write TBS HTML template pages.

4 、 XTemplate

XTemplate is a template engine for PHP. It allows HTML code to be stored separately from PHP code. XTemplate contains many useful functions such as nested program blocks and various types of interpolation variables. The code is very concise and optimized.

5 、 Savant

Savant is a powerful but lightweight object-oriented PHP template engine. Unlike its template system, Savant does not compile templates into PHP by default, but uses PHP itself as its template language so you don't need to learn a new markup system. Savant has an object-oriented template plug-in system and output filters that allow you to quickly add new behaviors to it.

6 、 phemplate

Phemplate is a simple and fast PHP template engine. It allows variables and some dynamic blocks to be added to the template, including loops. The template engine can separate presentation from logic, that is, you can extract all HTML content from PHP scripts. Designers are free to change HTML without having to worry about messing up your PHP script.

7 、 Dwoo

Dwoo is a PHP5 template engine. Compatible with Smarty templates, which are completely rewritten on the basis of Smarty syntax. Support to extend its functionality through plug-ins.

8 、 Sugar

Sugar is a template engine similar to Smarty, with a concise and easy-to-understand syntax.

9 、 Twig

Twig is a flexible, fast and secure PHP template language. It compiles the template into optimized raw PHP code. Twig has a sandbox model to evaluate untrusted template code. Twig consists of a flexible lexical analyzer and parser that allows developers to define their own tags, filters, and create their own DSL.

10 、 FXL Template

FXL Template is an easy-to-use template engine that provides all the basic functions of a template system. Support for simple text/array allocation, block and nested blocks. Have good regular expressions and simple template syntax to achieve template processing as quickly as possible.

11 、 H2o

H2O is a PHP template engine with beautiful template tags in django style. Most of its concepts are derived from Django templates. Features: have readable and natural syntax. Reuse template Inclusion and inheritance. International support. Various cache support.

12 、 ns-template

Around May 2010, I felt that the data concept of active invocation of DEDE tags was suitable for CMS, so I developed some Smarty custom modifiers and custom tags, but the performance was poor and the overhead was calculated in s, which is intolerable. Analysis tracking, limited by the principle of custom tag implementation, cannot be fast. So add a lot of smarty syntax and custom tag function on the basis of dz template. After more than a year of online operation and bug repair, and made up for the problem of multi-level nesting of DEDE tags, the version was released under relatively stable conditions.

13 、 Blade

Blade is a simple and powerful template engine under the framework of Laravel. Blade is very fast because only a small number of regular expressions are used to compile your template into raw PHP code. Unlike the controller layout, the Blade template engine is driven by template inheritance and template fragments. All Blade template files must use the Blade.blade.php file extension.

At this point, I believe you have a deeper understanding of "what template engines php has". 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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report