Why Do I Need to Build a Templating System?
Step 1 Plan the System
- What We Need to Build
- How the Templating System Works
- Create the Folder Structure
- Create the Main Files
- What Would the HTML Look Like?
- Use the Variable Data to Choose Template Tags
- Tie the Entries to the Templating System
- Make Sure the File Exists
- But First, a Word About Regular Expressions
- Get Ready for Testing
- Remove Comments from the Template File
- Separate the Header, Footer, and Loop for Processing
- Isolate the Main Entry Loop
- Isolate the Header
- Isolate the Footer
- Identify Template Tags with Regular Expressions
- Wait. What Did You Just Say?
- Write the Currying Method
- How Does Currying Apply to the Templating System?
- Write the Tag Replacing Method
- Modify the Template Parsing Method to Replace Template Tags
- Replace Template Tags in the Header and Footer of the Template
- Create a Template
- Load Real Entries and Use the New Template
For more details, refer this url :
https://code.tutsplus.com/tutorials/roll-your-own-templating-system-in-php--net-16596
write by :
Che Wahida (programmer team)
write by :
Che Wahida (programmer team)
0 comments:
Post a Comment