2 Maypole - MVC web application framework
5 See Maypole::Application.
8 This documents the Maypole request object. For user documentation, see
13 Returns the Maypole::Config object
16 My::App->setup($data_source, $user, $password, \%attr);
18 Initialise the maypole application and model classes. Your application
19 should call this after setting configuration via "config"
22 You should not call this directly, but you may wish to override this to
23 add application-specific initialisation.
26 Get/set the Maypole::View object
29 sub My::App::debug {1}
31 Returns the debugging flag. Override this in your application class to
32 enable/disable debugging.
36 Turns the backend request (e.g. Apache::MVC, Maypole, CGI) into a
37 Maypole request. It does this by setting the "path", and invoking
38 "parse_path" and "parse_args".
40 You should only need to define this method if you are writing a new
44 Returns the request path
47 Parses the request path and sets the "args", "action" and "table"
51 The table part of the Maypole request path
54 The action part of the Maypole request path
57 A list of remaining parts of the request path after table and action
61 Turns post data and query string paramaters into a hash of "params".
63 You should only need to define this method if you are writing a new
67 Returns a hash of request parameters. The source of the parameters may
68 vary depending on the Maypole backend, but they are usually populated
69 from request query string and POST data.
71 Note: Where muliple values of a parameter were supplied, the "params"
72 value will be an array reference.
75 Implimentation-specific path to template root.
77 You should only need to define this method if you are writing a new
78 Maypole backend. Otherwise, see "template_root" in Maypole::Config
81 You should only need to define this method if you are writing a new
82 Maypole backend. It should return something that looks like an Apache or
83 CGI request object, it defaults to blank.
86 Returns a Maypole::Constant to indicate whether the request is valid.
88 The default implimentation checks that "$r->table" is publicly
89 accessible and that the model class is configured to handle the
93 Returns a Maypole::Constant to indicate whether the user is
94 authenticated for the Maypole request.
96 The default implimentation returns "OK"
99 Returns the perl package name that will serve as the model for the
100 request. It corresponds to the request "table" attribute.
103 Called before the model processes the request, this method gives you a
104 chance to do some processing for each request, for example, manipulating
108 Get/set a list of model objects. The objects will be accessible in the
111 If the first item in "$r->args" can be "retrieve()"d by the model class,
112 it will be removed from "args" and the retrieved object will be added to
113 the "objects" list. See Maypole::Model for more information.
116 $r->template_args->{foo} = 'bar';
118 Get/set a hash of template variables.
121 Get/set the template to be used by the view. By default, it returns
125 This method is called if any exceptions are raised during the
126 authentication or model/view processing. It should accept the exception
127 as a parameter and return a Maypole::Constant to indicate whether the
128 request should continue to be processed.
131 Get/set a request error
134 Get/set the response output. This is usually populated by the view
135 class. You can skip view processing by setting the "output".
138 Get/set the output encoding. Default: utf-8.
141 Get/set the output content type. Default: text/html
144 Sends the output and additional headers to the user.
147 This method first checks if the relevant model class can authenticate
148 the user, or falls back to the default authenticate method of your
152 This model is called to catch exceptions, first after authenticate ,then
153 after processing the model class, and finally to check for exceptions
156 This method first checks if the relevant model class can handle
157 exceptions the user, or falls back to the default exception method of
158 your Maypole application.
161 This method sets up the class if it's not done yet, sets some defaults
162 and leaves the dirty work to handler_guts.
165 This is the core of maypole. You don't want to know.
168 There's more documentation, examples, and a wiki at the Maypole web
171 http://maypole.perl.org/
173 Maypole::Application,Apache::MVC, CGI::Maypole.
176 Sebastian Riedel, c<sri@oook.de>
179 Simon Cozens, "simon@cpan.org"
182 Danijel Milicevic, Dave Slack, Jesse Sheidlower, Jody Belka, Marcus
183 Ramberg, Mickael Joanne, Simon Flack, Veljko Vidovic and all the others
187 You may distribute this code under the same terms as Perl itself.