title: Render/Redirect to Another View Using Portlets
body: <p>I have a login portlet up and running that's based on <a href="http://yii.googlecode.com/svn/branches/1.0/docs/blog/portlet.login.txt" rel="nofollow noreferrer">this</a> tutorial.  It works just fine, however, if there is an error with the login form the error messages are displayed within the portlet and they aren't very prominent.  </p>
  
  <p>The portlet follows:</p>
  
  <pre><code>class UserLogin extends Portlet
  {
      public $title='Login';
  
      protected function renderContent()
      {
          $form=new LoginForm;
          if(isset($_POST['LoginForm']))
          {
              $form->attributes=$_POST['LoginForm'];
              if($form->validate())
                  $this->controller->refresh();
          }
          $this->render('userLogin',array('form'=>$form));
      }
  }</code></pre>
  
  <p>I would prefer any error to cause the login attempt to redirect to a full login form where the errors can be displayed prominently and it will be clear to the user something has gone wrong.</p>
  
  <p>Something along the lines of:</p>
  
  <pre><code>if($form->validate())
      $this->controller->refresh();
  else                
      $this->render('login',array('form'=>$form));
  </code></pre>
  
  <p>The else bit isn't correct, however, and I can't seem to figure out how to make it happen.</p>