Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2020-09-15 (4 months ago)  | | Not yet rated by the users | | Total: 36 | | All time: 10,045 This week: 270 |
Details
InTpl
Simple PHP templates supporting Template Inheritance.
Example:
[VIEWS]/layout/base.tpl.php
:
<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php $this->start('title'); ?>No Title<?php $this->end('title'); ?></title>
</head><body>
<?php $this->start('content'); ?>
No Content
<?php $this->end('content'); ?>
</body></html>
[VIEWS]/index.tpl.php
:
<?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:
<?php
define('VIEWS', dirname(__FILE__));
include(VIEWS . '/InTpl.php');
echo InTpl::Tpl('index.tpl.php', array(VIEWS))->render(array(/../));
output:
<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Index</title>
</head><body>
<p>Index page</p>
</body></html>
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.