Permalink
Browse files

example for workshop

  • Loading branch information...
1 parent 7a31889 commit fe6712b7a20163df0e39bb46bce489b45d704b3c Zbigniew Lukasiak committed Jul 19, 2010
Showing with 43 additions and 0 deletions.
  1. +16 −0 examples/myapp/MyApp.pm
  2. +21 −0 examples/myapp/MyApp/Controller.pm
  3. +5 −0 examples/myapp/app.psgi
  4. +1 −0 examples/myapp/templates/templated
View
@@ -0,0 +1,16 @@
+use strict;
+use warnings;
+
+package MyApp;
+use base 'WebNano';
+use WebNano::TTTRenderer;
+
+sub new {
+ my $class = shift;
+ my $self = $class->SUPER::new( @_ );
+ $self->renderer( WebNano::TTTRenderer->new( root => 'templates' ) );
+ return $self;
+}
+
+1;
+
@@ -0,0 +1,21 @@
+use strict;
+use warnings;
+
+package MyApp::Controller;
+
+use base 'WebNano::Controller';
+
+
+sub index_action {
+ my $self = shift;
+ return 'Hello World';
+}
+
+sub templated_action {
+ my $self = shift;
+ return $self->render( 'templated' );
+}
+
+
+1;
+
View
@@ -0,0 +1,5 @@
+use MyApp;
+my $app = MyApp->new();
+$app->psgi_callback;
+
+
@@ -0,0 +1 @@
+Example.

0 comments on commit fe6712b

Please sign in to comment.