Passing data back to form on invalid submission I currently have a form that is being displayed to the user via a custom route.

The form submits to a controller. The first thing the controller does is populate a custom model and validates it.

If the model fails validation, I want to skip the rest of the controller and pass the model back to the form. What is the best way to do this? I tried using craft()-&gt;urlManager-&gt;setRouteVariables and a $this-&gt;redirect, but the route variable didn't seem to come through, which I imagine is because setRouteVariables isn't supposed to be used like that.
You can call setRouteVariables and not return anything from your controller so the request continues as normal.  Craft does this all the time with it's own controllers.  See this answer for the general controller workflow.