In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "what are the basics of smarty template engine". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the basics of smarty template engine".
The details are as follows:
I. basic concepts
1. What is mvc?
Mvc is a kind of development mode, the core idea is: data input, data processing, data display forced separation.
two。 What is smarty?
Smarty is a template engine for php. More specifically, it can help developers better separate program logic from page display.
Operation principle of 3.smarty
A template file is a template that displays data, in which the data to be displayed is replaced by placeholders.
When smarty is running, it will read the template file, replace the placeholders in the template file with real data, and output a processed php file for the server to run.
Write a smarty template by yourself
In order to better understand the smarty template, now write your own smarty template-minismarty, so that you can have a more in-depth understanding of how smarty works.
1. Create a new project minismarty
Create a new template file path: templates
The compiled file path of the new template file: templates_c
Create a new template file: intro.tpl
Create a new running file: index.php
Create your own smarty, that is, the file that processes the template: cls_MiniSmarty.php
two。 Write index.php files
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.