doujiufutaog59220 2009-10-23 13:15
浏览 26
已采纳

PHP中的多步形式 - MVC应用程序

I'm about to program a mutistep form in my MVC App (Self-made MVC framework) in which no data is to be inserted until the last step is finished.

I got the following issues/questions

  • I'd really like to find a kind of pattern to solve this problem, is there any?
  • I want it to be easy the perform a go back action, and get the data back in the last step. Question: Is a session the only way to pass the data? Are get parameter maybe a better/simpler option?
  • How have you solved this problem before
  • 写回答

7条回答 默认 最新

  • dqcd84732 2009-10-23 13:34
    关注

    Look how they implemented it in Symfony, it's quite well built in that framework.

    You just have to download it and look in your project: /lib/symfony/form

    Basically you should create classes for each one of your form inputs;

    • you could always create different and complex ones, then;
    • you go create validator classes for each of them (maybe configurable),
    • you store your data in PHP objects that you save in the session or cookie,

    I would not recommend saving using parameters, too many of them, you have to consider URL max size and browser limits.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(6条)

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度