]> git.decadent.org.uk Git - maypole.git/blob - lib/Maypole/Config.pm
9d0c900f6544a625d4ecb2905c11e02d1db300f4
[maypole.git] / lib / Maypole / Config.pm
1 package Maypole::Config;
2 use base qw(Class::Accessor::Fast);
3 use attributes ();
4
5 use strict;
6 use warnings;
7
8 # Public accessors.
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)
12 );
13
14 # Should only be modified by model.
15 __PACKAGE__->mk_ro_accessors(qw( classes tables table_to_class));
16
17 1;
18
19 =head1 NAME
20
21 Maypole::Config - Maypole Configuration Class
22
23 =head1 DESCRIPTION
24
25 This class stores all configuration data for your Maypole application.
26
27 =head1 METHODS
28
29 =head2 View related
30
31 =head3 application_name
32
33 This should be a string containing your application's name.
34
35 =head3 rows_per_page
36
37 This is the number of rows your application should display per page.
38
39 =head3 tables
40
41 Contains a list of all tables, if supported by model.
42
43 =head3 table_to_class
44
45 A hash containing a table to class mapping, if supported by model.
46
47 =head3 template_root
48
49 This is where your application can find its templates.
50
51 =head3 uri_base
52
53 This is the URI base that should be prepended to your application when
54 Maypole
55 makes URLs.
56
57 =head3 view
58
59 The name of the view class for your Maypole Application. Defaults to
60 "Maypole::View::TT".
61
62 =head2 Model-Related
63
64 =head3 classes
65
66 This config variable contains a list of your view classes. This is set
67 up by the
68 model class, and should not be changed in the view or the config.
69
70 =head3 display_tables
71
72 These are the tables that are public to your Maypole application.
73 Defaults to all the tables in the database.
74
75 =head3 dsn
76
77 The DSN to your database. Follows standard DBD syntax.
78
79 =head3 loader
80
81 This is the loader object (n.b. an instance, not a class name). It's set
82 up by the CDBI model to an instance of "Class::DBI::Loader" if it's not
83 initialized before calling setup().
84
85 =head3 model
86
87 The name of the model class for your Maypole Application. Defaults to
88 "Maypole::Model::CDBI".
89
90 =head3 ok_tables
91
92 These are the tables that Maypole should care about
93
94 =head3 pass
95
96 Password for database user.
97
98 =head3 opts
99
100 Other options to the DBI connect call.
101
102 =head3 user
103
104 Username to log into the database with.
105
106 =head1 SEE ALSO
107
108 L<Maypole>
109
110 =head1 AUTHOR
111
112 Sebastian Riedel, C<sri@oook.de>
113
114 =head1 AUTHOR EMERITUS
115
116 Simon Cozens, C<simon@cpan.org>
117
118 =head1 LICENSE
119
120 You may distribute this code under the same terms as Perl itself.
121
122 =cut
123