Movable Type Plugins for World Peace - Architecture 8

Structure of an MT Application

  • similar to CGI::Application or Apache::PageKit

    • One function -> One page

          sub get_email_address {
              my ($app) = @_;
              $app->build_page('enter_email_address.tmpl', $param);
          }
      
          sub validate_email_address {
              my ($app) = @_;
              my $email = $app->{query}->param('email');
      
          if ($email and Email::Valid->address($email)) {
              send_letter();
          }
          else {
              $app->get_email_address;
          }
      

 

Toronto Perl Mongers << Previous | Index | Next >>
Michael Graham - 2003