Skip to content

Instantly share code, notes, and snippets.

@Rayne
Created November 21, 2015 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rayne/cdf579fa3cce78ba1466 to your computer and use it in GitHub Desktop.
Save Rayne/cdf579fa3cce78ba1466 to your computer and use it in GitHub Desktop.
Fat-Free Framework: TTL tests for `View` and `Preview` (`Template`)
<?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();
<?php echo $time;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment