Created
August 8, 2015 15:37
-
-
Save Rayne/2278d9078f8ccfd93e37 to your computer and use it in GitHub Desktop.
Fat-Free Framework: Adding new filters to Preview and Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hello {{ @date | date }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment