Custom registration User validation I'm building a custom registration process in which a set of entries and a user are created at the same time.

Currently I'm not able to pass back my errors in my controller into the front-end template.

(The following code should error out on purpose to test this functionality)

In my plugin controller:

$user = new UserModel;
$wasSaved = craft()-&gt;users-&gt;saveUser($user);

if ($wasSaved) {
     $was_assigned = craft()-&gt;userGroups-&gt;assignUserToGroups($user-&gt;id, array(1));
} else {
     $user-&gt;addErrors($user-&gt;getErrors());
     var_export($user-&gt;getErrors());
     return false;
}


In my template

{% macro errorList(errors) %}
{% if errors %}
  &lt;ul class="errors"&gt;
     {% for error in errors %}
         &lt;li&gt;{{ error }}&lt;/li&gt;
      {% endfor %}
  &lt;/ul&gt;
{% endif %}
{% endmacro %}

{% if account.getErrors is defined %}
    {{ _self.errorList(account.getErrors()) }}
{% endif %}


With the var_export($user-&gt;getErrors()); in my controller, I can see the errors at the top of the page:

array ( 'username' =&gt; array ( 0 =&gt; 'Username cannot be blank.', 1 =&gt; 'Username cannot be blank.', ),
'email' =&gt; array ( 0 =&gt; 'Email cannot be blank.', 1 =&gt; 'Email cannot be blank.', ), )


but these errors are not making it back into the actual template.

Any ideas?
It looks like you're not returning the user model back to the template.

You need something like this in your controller.

craft()-&gt;urlManager-&gt;setRouteVariables(array(
    'account' =&gt; $user
));