Redirector::login PHP Method

login() public method

Redirect to the login page $redirect_url is to send the user back to where he/she came from after login
public login ( string | null $redirect_url = null )
$redirect_url string | null
    public function login($redirect_url = null)
    {
        if (!empty($redirect_url)) {
            return $this->to(PUBLIC_ROOT . "?redirect=" . urlencode($redirect_url));
        } else {
            return $this->to(PUBLIC_ROOT);
        }
    }

Usage Example

Exemplo n.º 1
0
 /**
  * logout
  *
  */
 public function logOut()
 {
     $this->login->logOut(Session::getUserId());
     Redirector::login();
 }