AW: [Catalyst] Root.pm $c->detach() does not detach?
Hartmaier Alexander
Alexander.Hartmaier at t-systems.at
Tue Apr 3 17:54:01 GMT 2007
Hi!
Detach doesn't work in sub auto, use forward instead an return 0 after the
forward call.
For example I have in my Root.pm:
# force login for all pages
unless ($c->user_exists) {
# detach doesn't work the way it should in auto
$c->forward('/login/login');
return 0;
}
-Alex
> -----Urspr=FCngliche Nachricht-----
> Von: Luis Azevedo [mailto:braceta at sapo.pt]
> Gesendet: Dienstag, 03. April 2007 18:18
> An: The elegant MVC web framework
> Betreff: [Catalyst] Root.pm $c->detach() does not detach?
> =
> Hi All,
> =
> In Root.pm, "auto" action I am trying to break the execution of chain
> of
> Actions.
> =
> To be more exact, whenever I detect I loose connection to a socket or
> cookie
> session, I want to redirect the user to a login action, not rendering
> the
> action the user is calling.
> =
> I know I can make a simple $c->res->redirect() but the problem is I
> need to
> show a message in the login page telling the reason for the "logout".
> Usually
> I am passing messages trough Stash. Redirecting to the Login page needs
> to
> pass message somehow (through GET or POST, therefore not so beautiful
> s).
> =
> I have tried to detach the /login action, in "auto" action from
> Root.pm
> controller, but it is not working and I don't know why. See the
> actions
> chain:
> | /auto
> | -> /login/index
> | /about/index
> | /end
> =
> The user called the /about action.
> =
> Can I break the chain somehow in Root.pm, "auto" action?
> =
> Thanks in advance,
> =
> --
> Lu=EDs Azevedo
> =
> =
> =
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-
> archive.com/catalyst at lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5611 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070403/2c67=
acc6/smime.bin
More information about the Catalyst
mailing list