doulu8446 2009-11-19 19:41
浏览 58
已采纳

使用Zend Framework重定向传递参数而不附加到URL

In our application, we have certain scenarios where we'd like to perform a redirect and pass a long string to the next controller/action. I'm familiar with both of these:

$this->_redirect('/controller/action?string=thisistheverylongstring);

But would like to avoid showing the user the string as part of the URL.

Throwing the string in $this->view doesn't help because after a redirect, a new request is created.

As far as I know, using $this->_helper->redirector() has the same problem.

  • 写回答

1条回答 默认 最新

  • dua55014 2009-11-19 19:45
    关注

    I'm not super familiar with ZF's controller system so I can't give you a bespoke recommendation.

    Is using a session value out of the question? Another popular framework, symfony, uses what they call "flash" variables which are session values that survive for only 1 more request.

    I'm sure you could do something similar with ZF.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 Macbookpro 连接热点正常上网,连接不了Wi-Fi。
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程