Using set before rendering a different page

Permalink
Could anyone point me in the right direction here please?

class MySinglePage extends PageController {
  public function view($var=null){
    if(is_null($var)){
      $this->set('error','I am sending this error to the login page/view.'); 
      $this->render('/login');
    }
  }
}
}


And the $error variable is not set

mikemiller
 

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.