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 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?