1 package Maypole::Config;
2 use base qw(Class::Accessor::Fast);
11 __PACKAGE__->mk_accessors(
13 view view_options template_root template_extension build_form_elements
14 uri_base rows_per_page application_name
15 model loader display_tables ok_tables
22 # Should only be modified by model.
23 __PACKAGE__->mk_ro_accessors(qw( classes tables));
29 Maypole::Config - Maypole Configuration Class
33 This class stores all configuration data for your Maypole application.
39 =head3 application_name
41 This should be a string containing your application's name.
43 Optional. Is used in the factory templates.
47 This is the number of rows your application should display per page.
53 Contains a list of all tables, if supported by model.
55 =head3 template_extension
57 Optional template file extension.
61 This is where your application can find its templates.
65 This is the URI base that should be prepended to your application when Maypole
70 The name of the view class for your Maypole Application. Defaults to
73 =head3 build_form_elements
75 Globally specify whether to build form elements; populating the cgi metadata with
76 autogenerated HTML::Element widgets for the class/object.
78 Can be over-ridden per action using the method of the same name for the request.
80 If not set, then Maypole will assume it is true.
84 A hash of configuration options for the view class. Consult the documentation
85 for your chosen view class for information on available configuration options.
91 This config variable contains a list of your view classes. This is set
93 model class, and should not be changed in the view or the config.
97 This is a list of the tables that are public to your Maypole
98 application. Defaults to all the tables in the database.
102 The DSN to your database. Follows standard DBD syntax.
106 This is the loader object (n.b. an instance, not a class name). It's set
107 up by the CDBI model to an instance of "Class::DBI::Loader" if it's not
108 initialized before calling setup().
112 The name of the model class for your Maypole Application. Defaults to
113 "Maypole::Model::CDBI".
117 This is a hash of the public tables. It is populated automatically by
118 Maypole from the list in display_tables and should not be changed.
122 Password for database user.
126 Other options to the DBI connect call.
130 Username to log into the database with.
132 =head3 build_form_elements
134 Flag specifying whether to build metadata for form elements in factory templates
136 =head3 request_options
138 Hashref of options passed when creating cgi or apache request
140 =head2 Adding additional configuration data
142 You can use the 'additional' attribute for stashing additional info, especially from additional_data method,
143 i.e. $r->config->additional({foo=>bar});
147 If your modules need to store additional configuration data for their
148 own use or to make available to templates, add a line like this to your
151 Maypole::Config->mk_accessors(qw(variable or variables));
153 Care is needed to avoid conflicting variable names.
161 Sebastian Riedel, C<sri@oook.de>
163 =head1 AUTHOR EMERITUS
165 Simon Cozens, C<simon@cpan.org>
169 You may distribute this code under the same terms as Perl itself.