title: Zend Framework2 : Post is not working correctly
body: <p>I am a Zend Framework beginner.
  I guess My question is very basic... but I can't solve it by myself.</p>
  
  <p>In <strong>indexAction</strong>, <strong>$request->isPost()</strong> is always false.
  What is happening?</p>
  
  <p><strong>EntryController::indexAction</strong></p>
  
  <pre><code>public function indexAction() {
      $form = new AgreementForm();
      $form-&gt;get('submit')-&gt;setValue('Go Entry Form');
      $request = $this-&gt;getRequest();
      if ($request-&gt;isPost()) {
          var_dump('//// $request-&gt;isPost() is true //////');
          if ($form-&gt;get('agreementCheck')) {
              // Redirect to list of entries
              return $this-&gt;redirect()-&gt;toRoute('entry');
          } else {
              return array('form' =&gt; $form);
          }
      } else {
          var_dump('//// $request-&gt;isPost() is false //////');
          return array('form' =&gt; $form);
      }
  }
  </code></pre>
  
  <p><strong>form in index.phtml</strong></p>
  
  <pre><code>&lt;?php
  $form = $this-&gt;form;
  $form-&gt;setAttribute('action', $this-&gt;url('entry', array('action' =&gt; 'index')));
  $form-&gt;prepare();
  echo $this-&gt;form()-&gt;openTag($form);
  echo $this-&gt;formCheckbox($form-&gt;get('agreementCheck'));
  echo $this-&gt;formSubmit($form-&gt;get('submit'));
  echo $this-&gt;form()-&gt;closeTag();
  ?&gt;
  </code></pre>
  
  <p><strong>AgreementForm</strong> is generated using code generator.
  <a href="http://zend-form-generator.123easywebsites.com/formgen/create" rel="nofollow noreferrer">http://zend-form-generator.123easywebsites.com/formgen/create</a>
  as below.</p>
  
  <pre><code>class AgreementForm extends Form {
  
      public function __construct($name = null) {
          parent::__construct('');
  
          $this-&gt;setAttribute('method', 'post');
  
          $this-&gt;add(array(
              'name' =&gt; 'agreementCheck',
              'type' =&gt; 'Zend\Form\Element\MultiCheckbox',
              'attributes' =&gt; array(
                  'required' =&gt; 'required',
                  'value' =&gt; '0',
              ),
              'options' =&gt; array(
                  'label' =&gt; 'Checkboxes Label',
                  'value_options' =&gt; array(
                      '0' =&gt; 'Checkbox',
                  ),
              ),
          ));
  
          $this-&gt;add(array(
              'name' =&gt; 'csrf',
              'type' =&gt; 'Zend\Form\Element\Csrf',
          ));
  
          $this-&gt;add(array(
              'name' =&gt; 'submit',
              'attributes' =&gt; array(
                  'type' =&gt; 'submit',
                  'value' =&gt; 'Go',
                  'id' =&gt; 'submitbutton',
              ),
          ));
      }
  }
  </code></pre>
  
  <p>Please tell me some hints.</p>
  
  <p><strong>update:</strong>
  In the result of analysis by Developer Tools, POST and GET works at the same time.
  <img src="https://i.stack.imgur.com/F23Sn.png" alt="enter image description here"></p>
  
  <p><strong>update:</strong>
  router definition @module.config.php is this. </p>
  
  <pre><code>'router' =&gt; array(
          'routes' =&gt; array(
              'entry' =&gt; array(
                  'type' =&gt; 'segment',
                  'options' =&gt; array(
                      'route' =&gt; '/entry[/][:action][/:id]',
                      'constraints' =&gt; array(
                          'action' =&gt; '[a-zA-Z][a-zA-Z0-9_-]*',
                          'id' =&gt; '[0-9]+',
                      ),
                      'defaults' =&gt; array(
                          'controller' =&gt; 'Entry\Controller\Entry',
                          'action' =&gt; 'index',
                      ),
                  ),
              ),
              'home' =&gt; array(
                  'type' =&gt; 'Zend\Mvc\Router\Http\Literal',
                  'options' =&gt; array(
                      'route' =&gt; '/',
                      'defaults' =&gt; array(
                          'controller' =&gt; 'Entry\Controller\Entry',
                          'action' =&gt; 'index',
                      ),
                  ),
              ),
          ),
      ),
  </code></pre>