Created
November 21, 2015 09:37
-
-
Save Rayne/cdf579fa3cce78ba1466 to your computer and use it in GitHub Desktop.
Fat-Free Framework: TTL tests for `View` and `Preview` (`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 'base.php'; | |
$f3 = Base::instance(); | |
$f3->DEBUG = 3; | |
$f3->UI = 'UI/'; | |
$f3->CACHE = 'folder=tmp/cache/'; | |
$f3->TEMP = 'tmp/temp/'; | |
$f3->route('GET /template', function(Base $f3) { | |
// ´Template` uses `Preview->render()` | |
echo Template::instance()->render('template.html', null, ['time' => time()], 5); | |
}); | |
$f3->route('GET /view', function(Base $f3) { | |
echo View::instance()->render('view.php', null, ['time' => time()], 5); | |
}); | |
$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
{{ @time }} |
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 echo $time; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment