title: How to detect which button was used to submit the form?
body: <p>I can't seem to detect a button press in cakephp4. In cake3 it was easy.</p>
  <p>In Form I have:</p>
  <pre><code>echo $this-&gt;Form-&gt;button('View Data', [
      'name' =&gt; 'viewdata',
      'type' =&gt; 'submit',
      'class' =&gt; 'btn btn-primary'
  ]); 
  </code></pre>
  <p>In Controller I have:</p>
  <pre><code>if ($this-&gt;request-&gt;is('post') ) {
      .... 
      debug($this-&gt;request-&gt;getDdata());
      if (!empty($this-&gt;request-&gt;getData('viewdata'))) {
  </code></pre>
  <p>I click the button and I see <code>'viewdata'=''</code> so it detects the button has been clicked but its made the value  <code>= null</code>? and I can't invoke the button press function of <code>viewdata</code>.</p>
  <p><a href="https://book.cakephp.org/4/en/views/helpers/form.html#creating-buttons-and-submit-elements" rel="nofollow noreferrer">https://book.cakephp.org/4/en/views/helpers/form.html#creating-buttons-and-submit-elements</a></p>