I think I might be confused by https://craftcms.com/docs/plugins/controllers#posting-to-controller-actions
I have a controller that I want to return a model when validation fails:
$post = craft()->request->getPost();
$requestModel = Micros_AuthModel::populateModel($post);
if ( ! $requestModel->validate())
{
craft()->urlManager->setRouteVariables(array(
'requestModel' => $requestModel
));
$this->redirectToPostedUrl();
}
I assumed I would have access to requestModel in the template that posted:
{% if requestModel is defined %}
{{ inspect(requestModel) }}
{% endif %}
But I that inspect() call never fires.
What am I missing?