Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: CGI::Application design strategy

by Ctrl-z (Friar)
on Mar 02, 2004 at 10:39 UTC ( #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() ;
    }
    else
    {
        $self->_generate_form();
    }

    # ... 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...  
</tmpl_if>
    <form>...</form>
Hope that helps



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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://333212]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2020-05-25 12:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (145 votes). Check out past polls.

    Notices?