Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: CGI::Application design strategy

by Ctrl-z (Friar)
on Mar 02, 2004 at 10:39 UTC ( [id://333212] : note . print w/replies, xml ) Need Help??

in reply to CGI::Application design strategy

Run_modes are like the public interface to your App - they dont need to account for everything your app does. Id be more likely to have just 1 runmode - login - that calls private methods depending on whether the appropriate username/password combo was coming in on the CGI params.
sub login
    my $self = shift;
    my $q    = $self->query(); # ?
    if($q->param("username") && $q->param("password"))
        $self->_verify_login() ;

    # ... do template stuff here
For login_retry - id probably just put a <TMPL_IF> in my original form template, and reuse it for the retry.
<tmpl_if name="BAD_LOGIN"> 
     Sorry please try again...  
Hope that helps

time was, I could move my arms like a bird and...