1 package Maypole::Config;
2 use base qw(Class::Accessor::Fast);
9 __PACKAGE__->mk_accessors(
10 qw( view uri_base template_root model loader display_tables ok_tables
11 rows_per_page dsn user pass opts application_name)
14 # Should only be modified by model.
15 __PACKAGE__->mk_ro_accessors(qw( classes tables));
21 Maypole::Config - Maypole Configuration Class
25 This class stores all configuration data for your Maypole application.
31 =head3 application_name
33 This should be a string containing your application's name.
37 This is the number of rows your application should display per page.
41 Contains a list of all tables, if supported by model.
45 This is where your application can find its templates.
49 This is the URI base that should be prepended to your application when
55 The name of the view class for your Maypole Application. Defaults to
62 This config variable contains a list of your view classes. This is set
64 model class, and should not be changed in the view or the config.
68 This is a list of the tables that are public to your Maypole
69 application. Defaults to all the tables in the database.
73 The DSN to your database. Follows standard DBD syntax.
77 This is the loader object (n.b. an instance, not a class name). It's set
78 up by the CDBI model to an instance of "Class::DBI::Loader" if it's not
79 initialized before calling setup().
83 The name of the model class for your Maypole Application. Defaults to
84 "Maypole::Model::CDBI".
88 This is a hash of the public tables. It is populated automatically by
89 Maypole from the list in display_tables and should not be changed.
93 Password for database user.
97 Other options to the DBI connect call.
101 Username to log into the database with.
103 =head2 Adding additional configuration data
105 If your modules need to store additional configuration data for their
106 own use or to make available to templates, add a line like this to your
109 Maypole::Config->mk_accessors(qw(variable or variables));
111 Care is needed to avoid conflicting variable names.
119 Sebastian Riedel, C<sri@oook.de>
121 =head1 AUTHOR EMERITUS
123 Simon Cozens, C<simon@cpan.org>
127 You may distribute this code under the same terms as Perl itself.