current location: Home > Download > Learning resources > php e-book > php smarty template tutorial
![php smarty template tutorial](https://img.php.cn/upload/webcode/000/000/000/5a8e8273ae21f111.png)
php smarty template tutorial
Classify: Learning materials / php e-book | Release time: 2018-02-22 | visits: 2838130 |
Download: 218 |
Latest Downloads
Red Alert Online
Delta Force
Pokémon UNITE
Fantasy Aquarium
Girls Frontline
Wings of Stars
Little Flower Fairy Fairy Paradise
Restaurant Cute Story
Shanhe Travel Exploration
Love and Producer
24 HoursReading Leaderboard
- 1 How to Automatically Fix Column Width to Fit Your Data in Excel
- 2 How to Import Tables From the Web to Excel 365
- 3 Kingdom Come: Deliverance 2 - How To Study Faster
- 4 Kingdom Come: Deliverance 2 - Fortuna Walkthrough
- 5 How to Control Windows Update Settings to Avoid Forced Restarts
- 6 How to Use the TREND Function in Excel
- 7 This Innovative Keyboard Is Interesting, but Is It Just a Gimmick?
- 8 How to Set YouTube to Automatically Rotate When Opened on Samsung Phones
- 9 How To See Captions for Any Video You Watch on a Samsung Galaxy Phone
- 10 I Always Use Excel to Create Heat Maps: Here's How You Can Too
- 11 You Can Now Buy Microsoft Office 2024
- 12 Marvel’s Spider-Man 2 Using More Video Memory, Top Fixes to Try
- 13 Samsung Galaxy S25 Series Hands-On: Extremely Iterative, but the Ultra Is Nicer to Hold
- 14 Kingdom Come: Deliverance 2 - Max Level Cap
- 15 What Is Apple’s Enhanced Visual Search and Should You Turn It Off?
Latest Tutorials
-
- Go language practical GraphQL
- 2684 2024-04-19
-
- 550W fan master learns JavaScript from scratch step by step
- 4064 2024-04-18
-
- Getting Started with MySQL (Teacher mosh)
- 2195 2024-04-07
-
- Mock.js | Axios.js | Json | Ajax--Ten days of quality class
- 2964 2024-03-29
MVC is a development model that emphasizes the forced separation of data input, processing, and display.
Smarty usage tutorial
1. How to configure our smarty
After unzipping, place the libs folder in the first-level directory of the website, and then create two folders
templates stores template files
templates_c stores compiled files
Create the initialization file smarty.ini.php again
Note:
1. Generally use <{}>
as the identifier separator for replacement variables.
Two ways to change the delimiter:
1. Change the source code: Smarty.class.php $left_delimiter Not recommended
2. Dynamic modification:
$Smarty->left_delimiter="<{";
$Smarty->right_delimiter="}>";
written before display
2.smarty allocates data
$smarty->assign("Address",$address);
Used to assign values to templates. You can specify a name/number pair or an associative array containing name/numbers.
$smarty->assign("aa",true); //Output 1
$smarty->assign("aa",false); //Output is empty
![](/static/newDowns/images/images/book.png)