current location: Home > Download > Learning resources > php e-book > php smarty template tutorial

php smarty template tutorial
Classify: Learning materials / php e-book | Release time: 2018-02-22 | visits: 2838192 |
Download: 218 |
Latest Downloads
Horror Beat Phase Maker
Himalayan Children
Zebra AI
Supermarket Manager Simulator
Red Alert Online
Delta Force
Pokémon UNITE
Fantasy Aquarium
Girls Frontline
Wings of Stars
24 HoursReading Leaderboard
- 1 macOS Development: Building Native Apps with Swift & Xcode
- 2 SQL and phpMyAdmin: A Beginner's Guide
- 3 Linux: A Look at Its Fundamental Structure
- 4 MongoDB vs. Oracle: Understanding Key Differences
- 5 Fix 0x00000078 “PHASE0_EXCEPTION” Error – 5 Methods Here - MiniTool
- 6 How to type multiple lines of comments in vscode
- 7 NYT Connections Answers And Hints - April 16, 2025 Solution #675
- 8 Game_Ship.exe Error in COD Warzone & Black Ops 6, Proven Tips
- 9 Expert Guide to Finding Blue Prince Save File Location Easily
- 10 How to fix RESULT_CODE_MISSING_DATA error in Chrome and Edge?
- 11 What is the difference between vscode and pycharm
- 12 Wanderstop Stuck on Loading Screen/Not Loading: Try 6 Solutions
- 13 Star Wars: Zero Company to Be Officially Revealed From Respawn and Bit Reactor This Weekend
- 14 What language is written in vscode
- 15 ‘Star Wars Zero Company’ Announced – Live Out Your Jedi Dreams in This New Turn-Based Tactics Game
Latest Tutorials
-
- Go language practical GraphQL
- 3141 2024-04-19
-
- 550W fan master learns JavaScript from scratch step by step
- 4473 2024-04-18
-
- Getting Started with MySQL (Teacher mosh)
- 2475 2024-04-07
-
- Mock.js | Axios.js | Json | Ajax--Ten days of quality class
- 3183 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
