PHP Template Inheritance (TI) is a PHP library for creating reusable HTML layouts (templates) for a site, using template inheritance technique. Since PHP TI lets you write everything in straight PHP, there is no need to learn another template language.
Compared to other template libraries PHP TI is very easy to use. Template Inheritance usually involves two separate templates, each in their own file: the parent template and the child template. The parent contains the HTML skeleton and markers for where content should go (this is where you call PHP TI using require_once). These markers are called blocks. The child then “fills-in” the blocks with content.
- Supports Empty Blocks
- Default Block Content & Overriding
- Every Block is always Executed
- Keep a parent’s block and incorporate additional content using Super Block
- Supports Nested Blocks
- Modify a block’s content before it is sent to the output using Block Filters
- Supports Base With No Blocks
- Utilizes PHP’s native output buffers and does not rely on any kind of expensive parsing
Developed by Adam Shaw; PHP Template Inheritance (TI) is available for download under MIT License. You can find further information, samples & download on PHP Template Inheritance (TI) Website.