Skip to content

Instantly share code, notes, and snippets.

@v9n
Created December 13, 2011 19:42
Show Gist options
  • Select an option

  • Save v9n/1473564 to your computer and use it in GitHub Desktop.

Select an option

Save v9n/1473564 to your computer and use it in GitHub Desktop.
Get name of current URI in a request
<?php
//Request::current()->uri is equal to $this->reqest->uri() in normal request or in first request of HMVC
//echo $this->request->uri(), Request::current()->uri();
//echo Route::name($this->request->route()); exit;
if (!$auth->logged_in() && (!in_array(Route::name($this->request->route()), $this->_requireAuthen) || Route::name(new Route(Request::current()->uri()))=='hash' ) ) {
$this->request->redirect('account/login');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment