Maypole::Config(3)
π Maypole::Config π
okay bestie, gather round, because this is the Maypole Configuration Class, and it's from the User Contributed Perl Documentation crew. It's literally the β¨config pageβ¨ for your whole Maypole app. Let's go.
πΈ NAME πΈ
Maypole::Config β Maypole Configuration Class. that's it, that's the name, slay. π
π¦ DESCRIPTION π¦
This class stores all the configuration data for your Maypole application. every single setting. it's the group chat where all your app's little preferences live, and everyone reads from it. periodt. π
β¨ METHODS β¨
π View related π
application_nameβ should be a string with your application's name in it. it's Optional, and it gets used in the factory templates. cute, right? πΈrows_per_pageβ the number of rows your application should display per page. also Optional. go off, pagination. πtablesβ contains a list of all the tables, if your model supports that. iykyk. πtemplate_extensionβ Optional template file extension. yeah, just that. iconic. β¨template_rootβ this is where your application can find its templates. home sweet home for your.ttfiles. πuri_baseβ the URI base that should be prepended to your application whenever Maypole makes URLs. don't forget it, bestie. π₯viewβ the name of the view class for your Maypole Application. defaults to"Maypole::View::TT". πbuild_form_elementsβ globally specify whether to build form elements β like, populating the cgi metadata with autogeneratedHTML::Elementwidgets for the class/object. it Can be over-ridden per action using the method of the same name for the request. and If not set, then Maypole will assume it is true. so like, the default vibe is yes. βview_optionsβ a hash of configuration options for the view class. consult the documentation for your chosen view class to find out what configuration options are even available, because that's class-dependent, no cap. π
π§ Model-Related π§
classesβ this config variable contains a list of your view classes. it's set up by the model class, and you should not change it in the view or the config. hands off, bestie. πdisplay_tablesβ a list of the tables that are public to your Maypole application. defaults to all the tables in the database. the whole menu. π½οΈdsnβ the DSN to your database. follows standard DBD syntax. πΎloaderβ this is the loader object (n.b. an instance, not a class name). it's set up by the CDBI model to an instance of"Class::DBI::Loader"if it's not initialized before callingsetup(). important distinction, don't come for me. βmodelβ the name of the model class for your Maypole Application. defaults to"Maypole::Model::CDBI". πok_tablesβ a hash of the public tables. it is populated automatically by Maypole from the list indisplay_tablesand should not be changed. seriously, leave it alone. πpassβ password for database user. shhh. π€«optsβ other options to the DBI connect call. the extras. πuserβ username to log into the database with. hi hello. πbuild_form_elementsβ flag specifying whether to build metadata for form elements in factory templates. yep, this one shows up again down here in the model section, and it's got its own separate description. both are real, both stay. πrequest_optionsβ hashref of options passed when creating cgi or apache request. π¦
π Adding additional configuration data π
You can use the 'additional' attribute for stashing additional info, especially from the additional_data method, like this:
$r->config->additional({foo=>bar});
Or..
If your modules need to store additional configuration data for their own use, or to make it available to templates, add a line like this to your module:
Maypole::Config->mk_accessors(qw(variable or variables));
β οΈ Care is needed to avoid conflicting variable names. no stepping on each other's toes in the config, bestie, that's the rule. π
π₯ SEE ALSO π₯
Maypoleβ the main character. go read that one too. π
π AUTHOR π
Sebastian Riedel, "sri@oook.de"
π AUTHOR EMERITUS π
Simon Cozens, "simon@cpan.org"
π LICENSE π
You may distribute this code under the same terms as Perl itself. periodt. π«Ά
and that's the whole page, bestie!! β¨ this gem came to you from perl v5.42.0, dated 2025-07-25 β mwah, love that for us, see you in the next manpage πππ¦
π¦ where this page comes from
- fedora 43: perl-Maypole 1:2.13-46.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms