Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/251.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何将修改后的变量作为Smarty 2中函数的第二个参数发送?_Php_Smarty2 - Fatal编程技术网

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

Php 如何将修改后的变量作为Smarty 2中函数的第二个参数发送?,php,smarty2,Php,Smarty2,我有一段代码,在我的模板中非常有效: {php} echo date("F j, Y | g:iA",strtotime($this->_tpl_vars['eventObj']->get_evt_starttime())); {/php} 我想写同样的东西没有PHP标签。我知道{$eventObj | strotime}将eventObj发送到strotime”,但是如何将此结果作为第二个参数发送到date 在将一个修改器的结果作为另一个修改器的第二个参数发送时,我在文

我有一段代码,在我的模板中非常有效:

{php}
    echo date("F j, Y | g:iA",strtotime($this->_tpl_vars['eventObj']->get_evt_starttime()));
{/php} 
我想写同样的东西没有PHP标签。我知道
{$eventObj | strotime}
eventObj
发送到
strotime
”,但是如何将此结果作为第二个参数发送到
date

在将一个修改器的结果作为另一个修改器的第二个参数发送时,我在文档中找不到任何内容。我只能找到将两个修改器应用于同一事物

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


谢谢!

在php中

$smarty->assign('time', "2012-01-01 01:01");
在smarty模板中

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

January  1, 2012 | 01:01 AM