PHP Classes


Recommend this page to a friend!
  Classes of Nikos M.   InTpl PHP Template Engine Inheritance   Download  
Role: Documentation
Content type: text/markdown
Description: Read me
Class: InTpl PHP Template Engine Inheritance
Render templates that inherit from other templates
Author: By
Last change: readme

* support defining list of possible templates and render first of them found in tplDirs
(useful for custom type templates or fallback to general-purpose templates)
Date: 1 year ago
Size: 3,613 bytes


Class file image Download


Simple PHP templates supporting Template Inheritance.

see also:

  • ModelView a simple, fast, powerful and flexible MVVM framework for JavaScript
  • tico a tiny, super-simple MVC framework for PHP
  • LoginManager a simple, barebones agnostic login manager for PHP, JavaScript, Python
  • SimpleCaptcha a simple, image-based, mathematical captcha with increasing levels of difficulty for PHP, JavaScript, Python
  • Dromeo a flexible, and powerful agnostic router for PHP, JavaScript, Python
  • PublishSubscribe a simple and flexible publish-subscribe pattern implementation for PHP, JavaScript, Python
  • Importer simple class & dependency manager and loader for PHP, JavaScript, Python
  • Contemplate a fast and versatile isomorphic template engine for PHP, JavaScript, Python
  • HtmlWidget html widgets, made as simple as possible, both client and server, both desktop and mobile, can be used as (template) plugins and/or standalone for PHP, JavaScript, Python (can be used as plugins for Contemplate)
  • Paginator simple and flexible pagination controls generator for PHP, JavaScript, Python
  • Formal a simple and versatile (Form) Data validation framework based on Rules for PHP, JavaScript, Python
  • Dialect a cross-vendor & cross-platform SQL Query Builder, based on GrammarTemplate, for PHP, JavaScript, Python
  • DialectORM an Object-Relational-Mapper (ORM) and Object-Document-Mapper (ODM), based on Dialect, for PHP, JavaScript, Python
  • Unicache a simple and flexible agnostic caching framework, supporting various platforms, for PHP, JavaScript, Python
  • Xpresion a simple and flexible eXpression parser engine (with custom functions and variables support), based on GrammarTemplate, for PHP, JavaScript, Python
  • Regex Analyzer/Composer Regular Expression Analyzer and Composer for PHP, JavaScript, Python



<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title><?php $this->start('title'); ?>No Title<?php $this->end('title'); ?></title>

<?php $this->start('content'); ?>
No Content
<?php $this->end('content'); ?>


<?php $this->extend('layout/base.tpl.php'); ?>

<?php $this->start('title'); ?>Index<?php $this->end('title'); ?>

<?php $this->start('content'); ?>
<p>Index page</p>
<?php $this->end('content'); ?>

driver code:


define('VIEWS', dirname(__FILE__));

include(VIEWS . '/InTpl.php');

echo InTpl::Tpl('index.tpl.php', [VIEWS])->render([/../]);


<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


<p>Index page</p>