1Maypole::View::Base(3)User Contributed Perl DocumentationMaypole::View::Base(3)
2
3
4
6 Maypole::View::Base - Base class for view classes
7
9 This is the base class for Maypole view classes. This is an abstract
10 class that defines the interface, and can't be used directly.
11
12 process
13 This is the entry point for the view. It templates the request and
14 returns a "Maypole::Constant" indicate success or failure for the view
15 phase.
16
17 Anyone subclassing this for a different rendering mechanism needs to
18 provide the following methods:
19
20 template
21 In this method you do the actual processing of your template. it should
22 use paths to search for components, and provide the templates with easy
23 access to the contents of vars. It should put the result in
24 "$r->output" and return "OK" if processing was sucessfull, or populate
25 "$r->error" and return "ERROR" if it fails.
26
28 Additionally, individual derived model classes may want to override the
29
30 new
31 The default constructor does nothing. You can override this to perform
32 actions during view initialization.
33
34 paths
35 Returns search paths for templates. the default method returns folders
36 for the model class's "moniker", factory, custom under the configured
37 template root.
38
39 vars
40 returns a hash of data the template should have access to. The default
41 one populates classmetadata if there is a table class, as well as
42 setting the data objects by name if there is one or more objects
43 available.
44
45 error
46perl v5.32.1 2021-01-27 Maypole::View::Base(3)