Skip to content

jdsharp/php-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

PHP Simple Template Class

This class is a simple PHP wrapper for a Template pattern. PHP already does an excellent job of jumping in and out of Markup, this class need only be a small wrapper. Its purpose is to contain the scope of variables, support template inclusion and optionally capture rendered template for storage/caching.

Usage

some-page.php

<?php

require_once('template.class.php');

$t = new Template();
$t->set('title', 'The page title');
$t->display('my-template.php');

my-template.php

<html>
<head>
	<title><?php echo $title ?></title>
</head>
<body>
</body>
</html>

About

Minimal wrapper for extracting views into a template

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages