title: In October CMS, How to redirect from a plugin to a page with data
body: <p>I'm creating a plugin for October CMS that has a frontend form (component) with</p>
  
  <pre><code>{{ form_open({ request: 'onSubmitForm' }) }}
  </code></pre>
  
  <p>In the plugin there is a function <code>onSubmitForm()</code> with a <code>validator</code>.
  If the validator fails I want to redirect to the page the form input came from (<code>$this-&gt;page-&gt;url</code>) but send the validator messages (<code>$validator-&gt;messages()</code>) and the original input of the form (<code>post()</code>) with it.</p>
  
  <p>I've tried:</p>
  
  <pre><code>if ($validator-&gt;fails()) {
    return Redirect::to($this-&gt;page-&gt;url)-&gt;withErrors($validator-&gt;messages())-&gt;withInput(post());
  }
  </code></pre>
  
  <p>and if I put <code>{{ errors }}</code> on the page i do get a message</p>
  
  <blockquote>
    <p>Object of class Illuminate\Support\ViewErrorBag could not be converted
    to string</p>
  </blockquote>
  
  <p>which I then fixed by using:</p>
  
  <pre><code>{% for error in errors.all() %}
    &lt;li&gt;{{ error }}&lt;/li&gt;
  {% endfor %}
  </code></pre>
  
  <p>and <code>{{ errors.first('name') }}</code></p>
  
  <p>but the <code>{{ input }}</code> doesn't even return an error.</p>
  
  <p>Am I doing the redirecting wrong? Or does it have to do with how Twig and Blade are so completely different? Is there a way to prefill old input values and error messages?</p>