in reply to CGI::Prototype - let me clarify the response phase for you
But the question becomes where do model actions occur and how do we change pages based on this?You are thinking about the problem incorrectly. There should *not* be a MyApp::Update::Validate package. There should be a MyApp::Update::HandleUpdate page which has the logic above and then executes the model actions before returning a response so that the responses can come from subclasses of HandleUpdate... here's the code:
package MyApp::Update::HandleUpdate; # <-- note new package name sub model_actions { } sub response { my $self = shift; my $response; if (not validated) { $response = 'Redo'; } elsif (not authorized) { $response = 'NotAuthorized' } elsif (not authenticated) { $response = 'NotAuthenticated'; } else { # just render here. # if we felt like it, we could have __PACKAGE::success # and __PACKAGE::failure $response='HandleUpdate'; } $response = "MyApp::Login::$response"; return $response; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CGI::Prototype - let me clarify the response phase for you
by dragonchild (Archbishop) on Feb 07, 2005 at 14:20 UTC | |
by Anonymous Monk on Feb 08, 2005 at 02:01 UTC |