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 MATLAB代码补全插值
  • ¥15 Typegoose 中如何使用 arrayFilters 筛选并更新深度嵌套的子文档数组信息
  • ¥15 前后端分离的学习疑问?
  • ¥15 stata实证代码答疑
  • ¥50 husky+jaco2实现在gazebo与rviz中联合仿真
  • ¥15 dpabi预处理报错:Error using y_ExtractROISignal (line 251)
  • ¥15 在虚拟机中配置flume,无法将slave1节点的文件采集到master节点中
  • ¥15 husky+kinova jaco2 仿真
  • ¥15 zigbee终端设备入网失败
  • ¥15 金融监管系统怎么对7+4机构进行监管的