Skip to content

Instantly share code, notes, and snippets.

@maxparm
Created March 12, 2012 18:54
Show Gist options
  • Save maxparm/2023951 to your computer and use it in GitHub Desktop.
Save maxparm/2023951 to your computer and use it in GitHub Desktop.
Lithium - redirect in controller's _init
class FooController extends \lithium\action\Controller {
public function _init() {
parent::_init();
$userNotConnected = true;
if($userNotConnected) {
return $this->redirect('logout', array('exit'=>true));
}
}
public function index() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment