Skip to content

Instantly share code, notes, and snippets.

@Awilum
Created February 17, 2012 08:08
Show Gist options
  • Save Awilum/1851742 to your computer and use it in GitHub Desktop.
Save Awilum/1851742 to your computer and use it in GitHub Desktop.
Tweetpl - php template engine in less that 140 bytes
<?php
include 'tweetpl.php';
$user = 'Awilum';
Tweetpl::display('profile.php', array('user' => $user));
Welcome, <?php echo $user; ?>
class Tweetpl{static function display($f,$v=array()){ob_start();extract($v,1);if(!@include$f)echo'Ooops...';echo ob_get_clean();}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment