What is the role of PHP smarty templates?

Source: Internet
Author: User
On the net to see is the front and back end of the separation, easy to set data, but I feel is smarty syntax is more complex, no PHP basic syntax is simple, feel direct to write PHP is simpler, do not know what the role of using Smarty?

Reply content:

On the net to see is the front and back end of the separation, easy to set data, but I feel is smarty syntax is more complex, no PHP basic syntax is simple, feel direct to write PHP is simpler, do not know what the role of using Smarty?

If you are studying, you can use it, but few people use it in actual production.

There are a lot of good PHP frameworks, such as Laravel, CodeIgniter, Yii, etc., you can learn these.

Useful!!!!

The finished code looks better ...

Smarty All of these templates are theoretically easy to develop and safe to filter, but the program requires additional parsing and compilation, which is more efficient than native PHP nesting

The function of the template is to separate the front and back end, recommend twig template instead of smarty. If you are very concerned about performance, you can also use the ob_** () function to do a simple template function.

  • 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.