Answers.Body: <p>I would suggest either using query parameters in your redirect method, or storing it in session variables (which should be no different than regular PHP).</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-18T14:33:55.053Z
Answers.Text: Hoped to avoid that, but thanks :)
Answers.UserDisplayName: Victor
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-17T17:40:10.720Z
Answers.LastActivityDate: 2014-07-17T17:40:10.720Z
Answers.UserDisplayName: Bryan Redeagle
Body: <p>I have a <a href="http://buildwithcraft.com/docs/plugins/controllers#posting-to-controller-actions" rel="nofollow">Controller Action</a> which should pass on some data from one (CP) template to another:</p>
  
  <ol>
  <li>Template 1 (<code>plugin/form</code>): Form sends data</li>
  <li>Controller redirects data to Template 2</li>
  <li>Template 2 (<code>plugin/</code>): Shows data</li>
  </ol>
  
  <p>I don't want to just load the template but redirect to <code>plugin/</code> and show the data, any ideas?</p>
  
  <pre class="lang-php prettyprint-override"><code>public function actionTemplate()
  {
      $data = 'Something';
      $this-&gt;redirect( 'plugin_handle' ); //Pass on $data to 'plugin/'
  }
  </code></pre>
  
  <p><strong>Edit 1:</strong></p>
  
  <p>Or is there a way to send a post-request to a "route" rather then an actionController?</p>
  
Tags: <plugin-development><controller>
Title: How to perform a redirect and pass on data?
ThreadText: # How to perform a redirect and pass on data?
  
  (Asked by: username_0 on 2014-07-17)
  
  I have a [Controller Action](http://buildwithcraft.com/docs/plugins/controllers#posting-to-controller-actions) which should pass on some data from one (CP) template to another:
  
  1. Template 1 (`plugin/form`): Form sends data
  2. Controller redirects data to Template 2
  3. Template 2 (`plugin/`): Shows data
  
  I don't want to just load the template but redirect to `plugin/` and show the data, any ideas?
  
  ```php
  public function actionTemplate()
  {
      $data = 'Something';
      $this->redirect( 'plugin_handle' ); //Pass on $data to 'plugin/'
  }
  
  ```
  
  **Edit 1:**
  
  Or is there a way to send a post-request to a "route" rather then an actionController?
  
  **Tags:** plugin-development, controller
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-07-17. Score: 2
  
  I would suggest either using query parameters in your redirect method, or storing it in session variables (which should be no different than regular PHP).
  
  > **Comments:**
  > **username_0**: Hoped to avoid that, but thanks :)  
  
  ---
  
  