在zend中使用$this->url传递日期


Passing date using $this->url in zend?

我从模板文件中获取了以下代码,

<a onclick="previewPop('<?= $this->url(array('controller'=>'report', 'action'=>'generatepreview','report_date'=>str_replace("%2F", "/", urlencode($this->report_dt))), 'default', true)?>')" href="javascript:void(0);" title="Preview">Preview</a>

<script type="text/javascript">
function previewPop(url){
    window.open (url,"Invoice","menubar=1,resizable=1,width=850,height=550");
}
</script>

这里取url为

http://test.study.com/shop1/public/report/generatepreview/report_date/2011%2F10%2F20

结果为"Object not found!"。所以这里我想张贴数据,而不是附加在url。

http://test.study.com/shop1/public/report/generatepreview/report_date/2011%2F10%2F20

不是很好的URL,请尝试Unix时间戳或当前时间毫秒或其他格式的日期。

:

  • 20111020 - yyyymmdd
  • MjAxMSAxMCAyMA== base64编码版本2011 10 20(您可以解散方程)
  • 1319379406 - unix时间戳(当前为UTC)

,并在处理数据时在控制器中解码