It does not. It is Ajax. The javascript receives the information that is being produced by the echo statement, which will be JSON. When there are no errors that will be an empty result (I think) and the javascript does not show any errors. When there are errors in the JSON response the Javascript takes care of showing it on the screen.
After the output of the JSON the script should end. It does not go past Yii::app()->end();
Yes that is all correct, however what I don’t understand is that after echo’ing the errors there is “Yii::app()->end();”.
So when there are errors, the "Yii::app()->end();" ensures that it does not go any further in the code. However when there are no errors, how does it go further to process the normal form POST data?