duanhuan6336 2009-01-27 02:37
浏览 58
已采纳

基于PHP的表单验证助手?

From my time working with Ruby On rails, there is a couple different packaged/projects out there to manage both validation and error reporting in an extensible way.

Self-studying Python Pylons I just got introduced to HTMLFill which so far seems like an elegant solution to a common task of form validation.

I know both examples are features of Frameworks, or in the case of HTMLFill, intended to be part of a framework... still I don't remember seeing anything remotely as well polished in cakephp, code igniter, or even Zend framework. Am I missing something out there, or would it be worth while to attempt to imitate Python's HTMLFill in PHP5?

disclaimers: I've written Ajax based form validation systems that rely on embedding metadata like class="data-required data-email" and like but they've always seemed clunky to me.

I believe in the fat model philosophy of data validation, with the HTMLFill example above, I plan on packing my models with common HTMLFill schemes to each model, as is possible.

Links: HTMLFill - http://www.formencode.org/htmlfill.html#introduction

  • 写回答

2条回答 默认 最新

  • dqbh8054 2009-01-27 02:50
    关注

    The Zend Framework has the Zend_Validate class, it provides you a basic set of validators, you have also the Zend_Filter_Input class for data filtering, validation and escaping.

    I've also used Propel ORM Validation Framework to do validation at the model level.

    You can also enforce validation at the client side level, I recommend you the jQuery Validation plugin, it works really good...

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

报告相同问题?

悬赏问题

  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料