Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Simple PHP Template Engine

#7
I've done some more work refining this, and am now using it in a homegrown project of my own. It's actually managed to get the attention of a few folks I know from various places, so I'm glad to see that it seems to be in use so far. Tongue

Information Page: https://github.com/Darth-Apple/simple-ph...lates/wiki

Features implemented:
  • Template inheritance (extensions)
    • Allows a parent page to contain basic layout (header, footer, etc) with a child template containing page-specific data.
    • Allows blocks to be injected into a parent template at predefined locations
  • Listeners/Events (template hooks)
    • These allow functions to be called at predefined locations within the templates.
    • These are very useful for menus or sidebar blocks, where the content may need to be appended dynamically within PHP.
  • If/else blocks
  • Language packs/locale strings
  • Basic substitution variables
  • Template loops (PHP foreach)
  • Autoescape variables (XSS protection)
  • Template backreferences (include another template within a template)
  • Compiles to vanilla PHP (for native performance)

Footprint:

Lines: 231
Size: 8.3KB
Files: 1

Though it has grown, its lightweight spirit has remained a top priority during the development. It still weighs in under 10KB and is fully functional, containing many of the same features offered by the larger, more popular engines!

Reply


Messages In This Thread
Simple PHP Template Engine - by Darth-Apple - October 15th, 2020 at 10:03 PM
RE: Simple PHP Template Engine - by tc4me - October 16th, 2020 at 6:13 AM
RE: Simple PHP Template Engine - by Darth-Apple - November 25th, 2020 at 6:55 AM
RE: Simple PHP Template Engine - by Darth-Apple - January 17th, 2021 at 7:32 PM
RE: Simple PHP Template Engine - by Darth-Apple - January 19th, 2021 at 12:37 AM
RE: Simple PHP Template Engine - by tc4me - January 19th, 2021 at 6:31 AM
RE: Simple PHP Template Engine - by Darth-Apple - January 27th, 2021 at 6:49 AM
RE: Simple PHP Template Engine - by tc4me - January 27th, 2021 at 10:59 AM



Users browsing this thread: 1 Guest(s)

Dark/Light Theme Selector

Contact Us | Makestation | Return to Top | Lite (Archive) Mode | RSS Syndication 
Proudly powered by MyBB 1.8, © 2002-2024
Forum design by Makestation Team © 2013-2024