【发布时间】:2017-10-31 16:48:48
【问题描述】:
假设我在模板文件中加载了一个部分,我怎样才能自动添加文件扩展名,所以当我这样做时
{include file='partials/head'}
它实际上会这样做:
{include file='partials/head.tpl'}
编辑:在 Mustache 中,我可以这样做:
'loader' => new Mustache_Loader_FilesystemLoader('/resources/views', ['extension' => '.tpl.php'])
所以它会直接附加文件扩展名
【问题讨论】: