php - Using variables in fat-free framework template -
i'm reading fat-free framework user guide , want try display template uses f3s own template language. template displayed, variable not substituted , don't know why.
index.php
$f3 = require('../f3/base.php'); // moved lib dir 1 level $f3->set('ui', 'ui/'); $f3->route('get /*', function($f3) { $f3->set('test', 'foo'); echo view::instance()->render('layout.html', 'text/html'); } ); $f3->run();
layout.html contains
{{ @test }}
and displayed too, instead of "foo". other directives of f3 template language don't seem work either.
am missing step activate first or something?
you have use template class instead of view class
$f3 = require('../f3/base.php'); // moved lib dir 1 level $f3->set('ui', 'ui/'); $f3->route('get /*', function($f3) { $f3->set('test', 'foo'); echo template::instance()->render('layout.html'); } ); $f3->run();
Comments
Post a Comment