Skip to content

Instantly share code, notes, and snippets.

@Rayne
Created August 8, 2015 15:37
Show Gist options
  • Save Rayne/2278d9078f8ccfd93e37 to your computer and use it in GitHub Desktop.
Save Rayne/2278d9078f8ccfd93e37 to your computer and use it in GitHub Desktop.
Fat-Free Framework: Adding new filters to Preview and Template
<?php
require_once "../vendor/autoload.php";
class ExtTemplate extends Template {
public function date($timestamp) {
return date('d-m-Y' , $timestamp);
}
}
$f3 = Base::instance();
$f3->set('UI', './');
$f3->set('TEMP', 'tmp/');
$f3->route('GET /', function(\Base $f3){
$f3['date'] = 1234567890;
echo ExtTemplate::instance()->render('test.html');
});
$f3->run();
Hello {{ @date | date }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment