dpjuppr1361 2014-04-19 03:43
浏览 34
已采纳

Zend Framework 2表单

I have a simple question about ZF2. Why when and send a post to another method my post data is changed. I mean :

<input name="auth.mode" type="text"/>
<input name="block.seconds" type="text" />

It suppose get :

array(2) {
  ["auth.mode"] => string(1) "A"
  ["block.seconds"] => string(0) "12"
}

But I get :

array(2) {
  ["auth_mode"] => string(1) "A"
  ["block_seconds"] => string(0) "12"
}

I do not need my keys changed. I need my keys as in the HTML form with this name. Help please.

  • 写回答

1条回答 默认 最新

  • douyan6742 2014-04-19 09:07
    关注

    PHP is making this change, not ZF. You can't have dots in the $_POST etc. array key names, so PHP automatically converts them to underscores.

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

报告相同问题?

悬赏问题

  • ¥50 分布式追踪trace异常问题
  • ¥15 人在外地出差,速帮一点点
  • ¥15 如何使用canvas在图片上进行如下的标注,以下代码不起作用,如何修改
  • ¥15 Windows 系统cmd后提示“加载用户设置时遇到错误”
  • ¥50 vue router 动态路由问题
  • ¥15 关于#.net#的问题:End Function
  • ¥15 无法import pycausal
  • ¥15 weditor无法连接模拟器Local server not started, start with?
  • ¥20 6-3 String类定义
  • ¥15 嵌入式--定时器使用