title: Passing parameters through form to Controller (CakePHP)
body: <p>Okay, so I'm fairly new to CakePHP. This is the setup:</p>
  
  <p>I've got a Model (<em>Reservation</em>), and a controller, (<em>ReservationController</em>).</p>
  
  <p>I'm trying to provide a simple add() functionality.</p>
  
  <p>The request url is: www.example.com/reservations/add/3</p>
  
  <p>Where <strong>3</strong> is the ID of the event this reservation is for.
  So far, so good. The problem is, the form is constructed like this:</p>
  
  <pre><code> &lt;h2&gt;Add reservation&lt;/h2&gt;
  &lt;?php echo $form-&gt;create('Reservation');
  echo $form-&gt;input('first_name');
  echo $form-&gt;input('last_name');
  echo $form-&gt;input('email');
  echo $form-&gt;input('tickets_student'); echo $form-&gt;input('tickets_nstudent');
  echo $form-&gt;end('Add');?&gt;
  </code></pre>
  
  <p>When I hit the send button, the request URL becomes simply www.example.com/reservations/add/, and the event id is lost.</p>
  
  <p>I've solved it now by grabbing the id in the controller, and make it available to the form:</p>
  
  <pre><code>// make it available for the form
  $this-&gt;set('event_id', $eventid);
  </code></pre>
  
  <p>And then, in the form:</p>
  
  <pre><code>$form-&gt;create('Reservation',array('url' =&gt; array($event_id)));
  </code></pre>
  
  <p>It works, but it strikes me as a bit ugly. Isn't there an easier way to make sure the form POST action gets made to the current url, instead of the url without the id?</p>