Skip to content

Instantly share code, notes, and snippets.

@Rayne
Created November 20, 2015 13:25
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/031112f6300c0970f96b to your computer and use it in GitHub Desktop.
Save Rayne/031112f6300c0970f96b to your computer and use it in GitHub Desktop.
Fat-Free Framework: New `$ttl` attribute for <include>
<?php
$f3 = require 'base.php';
error_reporting(E_ALL);
$f3->DEBUG = 3;
$f3->UI = 'UI/';
$f3->CACHE = 'folder=tmp/cache/';
$f3->TEMP = 'tmp/temp/';
echo Template::instance()->render('test.html');
a:3:{i:0;s:42:"<h2>somefile.html</h2>
<p>1448025630</p>
";i:1;d:1448025630.0445809;i:2;i:0;}
<h1>test.html</h1>
<?php echo $this->render('somefile.html',$this->mime,get_defined_vars(),5); ?>
<h2>somefile.html</h2>
<p><?php echo time(); ?></p>
<h2>somefile.html</h2>
<p>{{ time() }}</p>
<h1>test.html</h1>
<!-- https://github.com/bcosca/fatfree-core/pull/96 -->
<include href="somefile.html" ttl="5"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment