Permalink
Browse files

the README that evolved from Bavl was more appropriate for Squatting

  • Loading branch information...
1 parent 3979927 commit 15d782e4db1d593b05fc3886c0da1eeb9ed93f5a John Beppu committed May 8, 2008
Showing with 83 additions and 12 deletions.
  1. +83 −12 README
View
95 README
@@ -7,22 +7,93 @@
. . . a Camping-inspired Web Microframework for Perl . . .
- A note for Awwaiid -- your first impression might be
- that I completely missed the point of Continuity, but
- do not worry. I am not done w/ Squatting, yet.
- RESTless controllers are coming soon, and they will
- (not RESTful) take full advantage of
- the foundation that
- Continuity has provided
- for the Squatting Microframework.
+ RANDOM NOTES
+ ============
+ Let's say you have an application called Bavl.
+ This is how you currently run this squatting application:
- A note for _why (if he happens to ever wander in here).
- I can't thank you enough for Camping.
- Its API is beautiful!
+ squatting Bavl
- (That's why I must share it with the Perl people.)
+ Bavl.pm needs to be discoverable through @INC.
+
+ - -*- -
+
+ If you're familiar w/ the Camping API,
+ the Squatting API will feel similar.
+
+ - -*- -
+
+ Bavl::Controllers is the package that contains all the controllers.
+
+ - -*- -
+
+ Controllers are objects (not classes)
+ that are constructed using the C() function.
+
+ - -*- -
+
+ Controllers represent HTTP Resources
+ that support HTTP Methods
+ like GET and POST with
+ the object methods
+ get and post.
+
+ This was the genius of Camping.
+ I can't think of a better way to
+ express RESTful controllers.
+
+ - -*- -
+
+ Bavl::Views is the package that contains all the views.
+
+ - -*- -
+
+ Views are also objects (not classes)
+ that are constructed using the V() function.
+
+ - -*- -
+
+ The methods of a view are thought of as templates.
+
+ - -*- -
+
+ The responsibility of a template is to
+ 1) take a hashref of variables and
+ 2) return a string.
+
+ You may use any templating system you want,
+ or even none at all.
+
+ - -*- -
+
+ You may define a layout template called 'layout'
+ which will be used to wrap the content of any other template.
+ If you don't want your template to be wrapped, you have
+ to give it a name with a '_' in front.
+
+ - -*- -
+
+ You may define a generic template called '_' for use when
+ a specific view can't be found.
+
+ - -*- -
+
+ You may have multiple views.
+
+ - -*- -
+
+ The first view you define is your default view.
+
+ - -*- -
+
+ The optional 2nd parameter to the render() method
+ lets you specify which view you want to use. For example,
+
+ $self->render('profile', 'json')
+
+ would render the 'profile' template using the 'json' view.

0 comments on commit 15d782e

Please sign in to comment.