encutened examples
[catagits/CatalystX-Declare.git] / examples / MyApp-Web / lib / MyApp / Web / View / Hello.pm
1 use CatalystX::Declare;
2
3 # nothing special here, so it's just normal MooseX::Declare syntax
4 view MyApp::Web::View::Hello {
5
6     # the process method is the standard method that is forwarded to
7     method process (Object $ctx) {
8
9         # render something
10         $ctx->response->body(
11             sprintf
12                 '<html><body><h1>Hello View: %s</h1></body></html>', 
13                 ($ctx->stash->{hello} || 'Hello World!'),
14         );
15     }
16 }