root/lang/perl/Ulgori/trunk/lib/Ulgori/Web/Handler.pm @ 13503

Revision 13503, 509 bytes (checked in by tokuhirom, 6 years ago)

a lot of Ulgori::* moved to Ulgori::Web::*.split web related stuff from core :)

Line 
1package Ulgori::Web::Handler;
2use Moose;
3use Ulgori::Web::Dispatcher;
4use Ulgori::Config;
5use Encode;
6
7sub handler {
8    my $c = shift;
9
10    if (my $x = Ulgori::Web::Dispatcher->match( $c->req )) {
11        my $controller = "Ulgori::Web::C::$x->{controller}";
12        my $action     = "dispatch_$x->{action}";
13
14        Class::MOP::load_class($controller);
15
16        $controller->$action( $c, $x->{args} );
17    } else {
18        $c->res->status(404);
19        $c->res->body( '404 dan the not found' );
20    }
21}
22
231;
Note: See TracBrowser for help on using the browser.