【发布时间】:2014-08-18 09:44:54
【问题描述】:
我正在阅读 fat-free 框架用户指南,并想尝试显示一个使用 F3 自己的模板语言的模板。模板显示出来了,但是变量没有被替换,不知道为什么。
index.php
$f3 = require('../f3/base.php'); // I moved the lib dir one level up
$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 只包含
{{ @test }}
这也正是显示的内容,而不是“foo”。 F3 模板语言的其他指令似乎也不起作用。
我是否错过了先激活它的步骤或其他什么?
【问题讨论】:
标签: php templates fat-free-framework