[Catalyst] begin and detach ?

raptor raptor at tvskat.net
Wed Jan 25 00:30:54 CET 2006


hi,

something like this :

sub begin : Private {
  $c->detach('nologin');
}

sub list : Local {
	....code...
   $c->log->info('list...');
   $c->stash(template => 'list.tt');
      $c->forward('...::View::TT');	
}
sub nologin : Private {
   ....
   $c->log->info('nologin...');
   $c->stash(template => 'nologin.tt');
   $c->forward('...::View::TT');
}


why if I access http://localhost/list

[Wed Jan 25 01:20:30 2006] [catalyst] [debug] Path is "list"
[Wed Jan 25 01:20:30 2006] [catalyst] [info] nologin...
[Wed Jan 25 01:20:30 2006] [catalyst] [debug] Rendering template "nologin.tt"
[Wed Jan 25 01:20:30 2006] [catalyst] [info] list....
[Wed Jan 25 01:20:30 2006] [catalyst] [debug] Rendering template "list.tt"

Why is 'list' executed ? 
I try to block access if the user is not logged /using $c->user_exists/..
other way to do it w/o placing check code inside every action ?




More information about the Catalyst mailing list