Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 91 lines (55 sloc) 3.102 kb
eef08d4 @beppu redid the README
authored
1 RANDOM NOTES
2 ============
3
4 There is an example application in the eg/ directory
5 called "Example".
6
7 This is how you currently run this squatting application:
8
9 cd eg/
10 squatting Example
11
12 (Example.pm needs to be discoverable through @INC.)
13
14 - -*- -
15
16 If you're familiar w/ the Camping API,
17 the Squatting API will feel similar.
18
19 - -*- -
20
21 Example::Controllers is the package that contains all the controllers.
22
23 - -*- -
24
25 Controllers are objects (not classes)
26 that are constructed using the C() function.
27
28 - -*- -
29
30 Controllers represent HTTP Resources
31 that support HTTP Methods
32 like GET and POST with
33 the object methods
34 get and post.
35
36 This was the genius of Camping.
37 I can't think of a better way to
38 express RESTful controllers.
39
40 - -*- -
41
42 Example::Views is the package that contains all the views.
43
44 - -*- -
45
46 Views are also objects (not classes)
47 that are constructed using the V() function.
48
49 - -*- -
50
51 The methods of a view are thought of as templates.
52
53 - -*- -
54
55 The responsibility of a template is to
56 1) take a hashref of variables and
57 2) return a string.
58
59 You may use any templating system you want,
60 or even none at all.
61
62 - -*- -
63
64 You may define a layout template called 'layout'
65 which will be used to wrap the content of any other template.
66 If you don't want your template to be wrapped, you have
67 to give it a name with a '_' in front.
68
69 - -*- -
70
71 You may define a generic template called '_' for use when
72 a specific template can't be found.
73
74 - -*- -
75
76 You may have multiple views.
77
78 - -*- -
79
80 The first view you define is your default view.
81
82 - -*- -
83
84 The optional 2nd parameter to the render() method
85 lets you specify which view you want to use. For example,
86
87 $self->render('profile', 'json')
88
89 would render the 'profile' template using the 'json' view.
90
Something went wrong with that request. Please try again.