PHP template technology smarty

Source: Internet
Author: User
Tags php source code php template

Introduction: This is a detailed page of PHP template technology smarty. It introduces PHP, related knowledge, skills, experience, and some PHP source code.

Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 341661 'rolling = 'no'>

Basic Information
INSTRUCTOR: Gao luofeng
Duration: 60 minutes
Number of sets: 9
Pricing per set: 20
Buy link: http://www.china-pub.com/3501568
Free: http://www.hztraining.com/bbs/showtopic-1175.aspx

Description:
If you are designing an interactive website, you will pay attention to two main issues: interface art and application.Program. In most project teams, developing a web program involves the following process: After the planning document is submitted, the interface designer (artist) creates the website appearance model and then submits it to the background programmer. Programmers use PHP to implement the program logic, and use the appearance model to make the basic architecture, and then the project is returned to the HTML page designer to continue to improve. In this way, the project may return several times between the background programmer and the page designer. Background programmers do not like to interfere with any HTML tags, and they do not need to be involved inCodeTogether. The artist only needs configuration files, dynamic blocks, and other interface parts, and does not need to access complicated PHP code. Therefore, it is very important to have a good template support.

For PHP, if the template engine is not used, it does not show the advantages of rapid php development, so the use of the template engine is no longer available in the PHP project. There are many template engines to choose from, but smarty is a PHP template engine written in PHP, which is currently the most famous and powerful in the industry. Like PHP, smarty has rich function libraries that can be used directly from word count statistics to automatic indentation, text wrapping, and regular expressions. If you don't think it is enough, smarty has strong scalability, it can be expanded in the form of plug-ins. In addition, smarty is also a free software that users can freely use, modify, and re-distribute. The advantages of smarty are summarized as follows.
Speed: compared with other template engine technologies, programs written with smarty can achieve the maximum speed.
Compilation type: a program written in smarty must be compiled into a non-template PHP file during runtime. This file adopts a mix of PHP and HTML, the next time you access the template, you can directly convert the Web request to this file, instead of re-compiling the template (if the source program is not changed). The subsequent calls are faster.
Cache Technology: smarty provides an optional cache technology that caches HTML files that you finally see into a static HTML page. When you enable the smarty cache and convert your Web requests to this static html file within the set time, this is equivalent to calling a static html file.
Plug-in technology: the smarty template engine is implemented using PHP's object-oriented technology. It can not only be modified in the original code, but also customize some function plug-ins (that is, some functions customized by rules ).
Powerful Presentation logic: the smarty template can process data through conditional judgment and iteration. It is actually a programming language, but the syntax is simple, designers can quickly learn it without having to prepare programming knowledge.

Directory:

I. php template technology introduction and Custom template engine

This section describes what the template engine is and why the template technology should be used in PHP development. It focuses on the working principle of the template engine, A custom template engine is used to explain in detail how the template engine works, and how to use the template engine in PHP. We hope that through this course we can not only understand the template technology, but also understand the principle of smarty.

Ii. install and configure smarty
This section is the beginning of smarty. It mainly introduces the advantages of smarty in many PHP template engines and the working principle of smarty. It also introduces in detail the installation and use of the smarty engine, A common issue of development is explained in detail. This section also focuses on how to use and optimize smarty objects. This is the first lesson to learn about smarty.

3. Use variables in smarty
Because smarty is variable-based, this section focuses on three ways to use variables in the smarty template, including how to assign various types of variables to the template in PHP, and how to use various types of variables in the template, and how to access the variables in the configuration file in the template, in this section, we also focus on the reserved variables and usage in the smarty template. This section also details how to use different variable methods. I hope you can master the content of this section and prepare for learning smarty in the future.

4. Use user-defined functions in the smarty Template
This section describes how to call PHP functions in the smarty template, including defining tags in the template, by writing function registration in PHP, we also introduced how to implement custom markup through plug-ins, as well as the types and declarations of functions that smarty can use, and smarty provides a good user-defined function application.

5. Use the variable mediation tool in smarty
This section describes how to use the variable mediation tool in the smarty template, focuses on the application of the variable mediation tool, and uses the custom variable mediation method, describes in detail how to create and use the variable mediation tool in the smarty template. It also introduces some built-in variable mediation tools of smarty, and explains the application of the variable mediation tool.

6. Use the built-in functions provided by smarty
This section describes the built-in functions in the smarty template. built-in functions cannot be modified. They can only be used as provided in the manual, including using flow control statements in the template, using foreach and section to traverse the array, this section focuses on the use of Section and the differences between section and foreach. We recommend that you use section to traverse the array in the template, colleagues also introduced some common built-in functions in smarty, which are essential for learning smarty.

7. Use the powerful Cache Technology in smarty
This section describes how to use the Cache Technology in the smarty template, including what is the cache technology and how to implement the smarty cache technology. If you enable the cache for smarty, this section focuses on the detailed usage of the cache, including how to block the content of dynamic output. If you specify a cache ID for each page and details how to use a local cache in smarty, the content of this lesson is also the focus of learning smarty.

8. Smarty Application Instances implement the home page of a website
This section is the application part of smarty. The main content is to use the smarty technology to implement a home page of a website. It introduces how artists and programmers work separately. This section describes how to use Div + CSS to implement page bureaus and output templates in PHP programs. Through the implementation of this example, you can consolidate the knowledge of smarty and use it in your own project development.

Love J2EE follow Java Michael Jackson video station JSON online tools

Http://biancheng.dnbcw.info/php/341661.html pageno: 6.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.