Apache::MVC(3)

πŸ“¦
version 2.13 Β· 2 versions
, in fedora 43

πŸ’– Apache::MVC πŸ’–

okay bestie, welcome to Apache::MVC β€” she's the Apache front-end to Maypole, and she's that girl. ✨


🌸 NAME 🌸

Apache::MVC β€” literally just: Apache front-end to Maypole. no cap. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

    package BeerDB;
    use Maypole::Application;

that's it. that's the whole vibe. πŸŽ€


✨ DESCRIPTION ✨

so like, Apache::MVC is a mod_perl platform driver for Maypole. 🧚

your app can inherit from Apache::MVC directly if you're feeling feral, but fr fr the recommended move is to use Maypole::Application instead. trust. 🫢


πŸ› οΈ INSTALLATION πŸ› οΈ

step one, bestie: create a driver module exactly like the one illustrated in Maypole::Application. slay.

step two, put this in your Apache config:

    <Location /beer>
        SetHandler perl-script
        PerlHandler BeerDB
    </Location>

step three: copy the templates found in templates/factory into the beer/factory directory off the web root. πŸ“

when the designers finally get back to you with custom templates (they will take forever, it's giving group project energy 😭), those go in beer/custom.

and if you need to override templates on a database-table-by-table basis? put the new template in beer/table. iconic. πŸ‘‘

this automatically gives you the add, edit, list, view and delete commands β€” for instance, to see a list of breweries, go to:

    http://your.site/beer/brewery/list
for more information about how the system works and how to extend it, see Maypole. 🌈

πŸŽ€ Implementation πŸŽ€

this class overrides a whole set of methods in the base Maypole class to provide its functionality. see Maypole for these:

  • get_request
  • warn
  • parse_location
  • parse_args
  • redirect_request β€” sets output headers to redirect based on the arguments provided.

accepts either a single argument of the full url to redirect to, or a hash of named parameters:

$r->redirect_request('http://www.example.com/path');

or

$r->redirect_request(protocol=>'https', domain=>'www.example.com',
path=>'/path/file?arguments', status=>'302', url=>'..');

the named parameters are protocol, domain, path, status and url.

only 1 named parameter is required, but other than url, they can be combined as required and current values (from the request) will be used in place of any missing arguments. 🫢 the url argument must be a full url including protocol, and can only be combined with status.

  • get_protocol
  • send_output
  • get_template_root

πŸ‘‘ AUTHOR πŸ‘‘

Simon Cozens, "simon@cpan.org" β€” legend behaviour, honestly. πŸ’œ


🌟 CREDITS 🌟

Aaron Trevena, Marcus Ramberg "marcus@thefeed.no", Sebastian Riedel "sri@oook.de" β€” the whole squad ate, no crumbs left. πŸ”₯


πŸ“œ LICENSE πŸ“œ

you may distribute this code under the same terms as Perl itself. periodt. πŸ’…


and that's the whole page, bestie!! this one's from perl v5.42.0, dated 2025-07-25, and it's filed under Apache::MVC(3) in the User Contributed Perl Documentation β€” mwah, go forth and slay your Maypole app πŸ¦‹βœ¨πŸ’–

πŸ“¦ where this page comes from