如何将修改后的变量作为Smarty 2中函数的第二个参数发送


How to I send a modified variable as the second parameter of a function in Smarty 2?

我有这样的代码,它在我的模板中非常有效:

{php}
    echo date("F j, Y | g:iA",strtotime($this->_tpl_vars['eventObj']->get_evt_starttime()));
{/php} 

我想在没有PHP标记的情况下写同样的东西。我知道{$eventObj|strtotime}会将eventObj发送到strtotime",但我如何将其结果作为第二个参数发送到date

我在文档中找不到任何关于将修改器的结果作为另一个修改器的第二个参数发送的信息。我只能发现对同一件事应用两个修饰符。

我厌倦了放括号和玩冒号语法,但它不起作用。我只需要问问别人。

谢谢!

在php中

$smarty->assign('time', "2012-01-01 01:01");

智能模板

{$time|strtotime|date_format:"%B %e, %Y | %H:%m %p"}

输出

January  1, 2012 | 01:01 AM