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; }
In reply to Re: CGI::Prototype - let me clarify the response phase for you
by metaperl
in thread CGI::Prototype - let me clarify the response phase for you
by metaperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |