我已经注册了一个负责翻译的块功能 .
$ smarty-> register_block(“translate”,“do_translation”);
function do_translation($ params,$ content,&$ smarty,&$ repeat)
我可以通过使用PHP中的$ smarty对象以某种方式确定哪个模板文件导致函数调用?或者howelse我可以获取内部的PHP,当前呈现的模板?
第三个参数是Smarty对象 . 我不确定,但你可以试试
echo $smarty->_current_file; //Smarty 2
要么
echo $smarty->template; //Smarty 3
1 回答
第三个参数是Smarty对象 . 我不确定,但你可以试试
要么