سؤال

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.

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top