title: Redirecting URL with variable in Zend Framework
body: <p>Whats the recommended method for redirecting with variables in Zend Framework? </p>
  
  <p>Lets say we have an action like this within a controller:</p>
  
  <pre><code> public function newAction()
      {
          $form = new Form_ApplicationForm();
          if($this-&gt;_request-&gt;isPost()){
              $data = $_POST;
              if($form-&gt;isValid($data)){
                  $appModel = new Model_Application();
                  $result = $appModel-&gt;createApplication($form-&gt;getValue('name'),
                      $form-&gt;getValue('email'),
                      $form-&gt;getValue('comments'));
                  if($result){
                      // redirect here 
                  }
              }else{
                  $form-&gt;populate($data);
              }
          }
          $this-&gt;view-&gt;form = $form;
      }
  </code></pre>
  
  <p>If i wanted to redirect to a URL where i could show something like:</p>
  
  <blockquote>
    <p>"Thanks for your application, your
    reference is #123"</p>
  </blockquote>
  
  <p>How should i perform this redirect?</p>
  
  <p>something like this maybe?</p>
  
  <pre><code>$this-&gt;_redirect('/application/confirm/'.$result);
  </code></pre>
  
  <p>If so then how would i access the <code>$result</code> var?</p>
  
  <p><strong>EDIT</strong> OR I guess this would work:</p>
  
  <pre><code>$this-&gt;_redirect('/application/confirm/?id='.$result);
  </code></pre>
  
  <p>.. but i'm not sure if this is best practice or not?</p>
  
  <p>I've seen examples where people use <code>_forward()</code> for their redirects but the URL never changes which creates issues with multiple submissions etc.</p>
  
  <p>I've seen someone recommend <code>gotoSimple()</code> but i'm not sure about this. Still a ZF noob so apologies if this is obvious but I guess this is something with multiple uses for CRUD type systems anyway so would be interested to know.</p>
  
  <p>Thanks</p>