【发布时间】:2010-12-01 20:46:18
【问题描述】:
我喜欢在 smarty 模板中使用来自助手的静态函数。我正在使用 ko3 和 kohana-module-smarty - https://github.com/MrAnchovy/kohana-module-smarty/ 所以我的问题是如何自动加载帮助程序并在模板中使用它,即:
app/class/url.php
类网址{
函数测试 () {
返回“测试”;
}
}
views/index.tpl
{$url.test}
【问题讨论】:
-
你应该已经添加了'php'标签